https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88713

            Bug ID: 88713
           Summary: _gfortran_internal_pack@PLT prevents vectorization
           Product: gcc
           Version: 8.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: elrodc at gmail dot com
  Target Milestone: ---

Created attachment 45350
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45350&action=edit
Fortran version of vectorization test.

I am attaching Fortran and C++ translations of a simple working example.

The C++ version is vectorized, while the Fortran version is not.

The code consists of two functions. One simply runs a for loop, calling the
other function.
The function is vectorizable across loop iterations. g++ does this
succcesfully.

However, gfortran does not, because it repacks data with
        call    _gfortran_internal_pack@PLT
so that it can no longer be vectorized across iterations.


I compiled with:

gfortran -Ofast -march=skylake-avx512 -mprefer-vector-width=512
-fno-semantic-interposition -shared -fPIC -S vectorization_test.cpp -o
gfortvectorization_test.s

g++ -Ofast -march=skylake-avx512 -mprefer-vector-width=512 -shared -fPIC -S
vectorization_test.cpp -o gppvectorization_test.s


LLVM (via flang and clang) successfully vectorizes both versions.

Reply via email to