-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[LV] Check early for supported interleave factors with scalable types [nfc] #111592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3406,6 +3406,7 @@ bool LoopVectorizationCostModel::interleavedAccessCanBeWidened( | |
| "Decision should not be set yet."); | ||
| auto *Group = getInterleavedAccessGroup(I); | ||
| assert(Group && "Must have a group."); | ||
| unsigned InterleaveFactor = Group->getFactor(); | ||
|
|
||
| // If the instruction's allocated size doesn't equal it's type size, it | ||
| // requires padding and will be scalarized. | ||
|
|
@@ -3414,9 +3415,14 @@ bool LoopVectorizationCostModel::interleavedAccessCanBeWidened( | |
| if (hasIrregularType(ScalarTy, DL)) | ||
| return false; | ||
|
|
||
| // We currently only know how to emit interleave/deinterleave with | ||
| // Factor=2 for scalable vectors. This is purely an implementation | ||
| // limit. | ||
| if (VF.isScalable() && InterleaveFactor != 2) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is this handled for AArch64 SVE? Does the change mean support for different factors must be added for all architectures with scalable vectors at the same time?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SVE also has a similar check in interleavedAccessCanBeWidened.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there's the same check just later in LV, could it be replaced by an assert?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I can't find this check except in the AArch64 cost model (now removed). What are you referring to?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is an IR representation issue. We have no way to represent in IR a interleave load or store at anything other than Factor=2 today. When we change that, yes, we will have to audit the cost models for each of the targets which support the new intrinsic. That seems pretty standard.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
My mistake. I mentioned the wrong function earlier; it should be getInterleavedMemoryOpCost rather than interleavedAccessCanBeWidened. |
||
| return false; | ||
|
|
||
| // If the group involves a non-integral pointer, we may not be able to | ||
| // losslessly cast all values to a common type. | ||
| unsigned InterleaveFactor = Group->getFactor(); | ||
| bool ScalarNI = DL.isNonIntegralPointerType(ScalarTy); | ||
| for (unsigned Idx = 0; Idx < InterleaveFactor; Idx++) { | ||
| Instruction *Member = Group->getMember(Idx); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.