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

Created attachment 19931

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

Reply via email to