http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51890

             Bug #: 51890
           Summary: vectorizer does not recognize intrinsic functions like
                    sqrt
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: heiko.kl...@gmx.net


Created attachment 26360
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26360
test code which does not vectorize properly

Compiling attached program with
gcc4.6.2/bin/gcc -std=c99 -O2 -mfpmath=sse -msse2 -lm -o test_novector 
test_novector.c -ftree-vectorize -ftree-vectorizer-verbose=2

results in the comment:
test_novector.c:8: note: not vectorized: loop contains function calls or data
references that cannot be analyzed

(older compilers, i.e. gcc4.4.3 just complain about data reference)


The only function call is sqrt(), but sqrt is an intrinsic vectorized function
(_mm_sqrt_pd) and can be easily vectorized. 


Due to missing vectorization, this code is 2x (4x with AVX) slower than
compiled with other compilers (tested against icc12).

Reply via email to