Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Reassociation messes up SLPVectorizer reduction #35829

Closed
@llvmbot

Description

@llvmbot
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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions