https://bugs.llvm.org/show_bug.cgi?id=36481

            Bug ID: 36481
           Summary: Reassociation messes up SLPVectorizer reduction
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: timshe...@gmail.com
                CC: llvm-bugs@lists.llvm.org

Created attachment 19931
  --> https://bugs.llvm.org/attachment.cgi?id=19931&action=edit
Test

Running `opt -S -slp-vectorizer $TEST_FILE`, the function gets SLP-vectorized;
Running `opt -S -reassociate -slp-vectorizer $TEST_FILE`, the function doesn't
get SLP-vectorized.

This is because the reassociation pass re-associates instructions like `acc =
add ith_element, acc` to `acc = add acc, ith_element`, but didn't re-assocate
the first instruction `acc = add first_element, second_element` to `acc = add
second_element, first_element`.

However, as add is associative, a smarter SLP vectorizer could have ignored the
associations and vectorize the unordered adds anyway.

I'm not sure where to put the fix on.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to