[PATCH] D14185: Extend SLP Vectorizer to deal with aggregates

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 17:49:01 PDT 2016


hfinkel added a comment.

Is this still waiting for other reviews? I'd like to get this functionality upstream; I just ran into this situation again today.

On x86_64/Linux (at least compiling with libstdc++), compiling the following (-O3 -ffast-math):

  #include <complex>
  using namespace std;
  
  complex<double> foo(complex<double> a, complex<double> b) {
    return a*b;
  }

yields this:

  define { double, double } @_Z3fooSt7complexIdES0_(double, double, double, double) #0 {
    %5 = fmul fast double %3, %0
    %6 = fmul fast double %2, %1
    %7 = fadd fast double %5, %6
    %8 = fmul fast double %2, %0
    %9 = fmul fast double %3, %1
    %10 = fsub fast double %8, %9
    %11 = insertvalue { double, double } undef, double %10, 0
    %12 = insertvalue { double, double } %11, double %7, 1
    ret { double, double } %12
  }

and we completely miss this kind of code because the natural chain starts at the insertvalues.


http://reviews.llvm.org/D14185





More information about the llvm-commits mailing list