Closed
Description
Bugzilla Link | 36481 |
Version | trunk |
OS | Linux |
Attachments | Test |
Reporter | LLVM Bugzilla Contributor |
CC | @alexey-bataev,@echristo,@MaskRay,@RKSimon,@rotateright |
Extended Description
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.