This is an archive of the discontinued LLVM Phabricator instance.

[LV][NFC] Use ElementCount for getMaxInterleaveFactor

Authored by luke on Feb 21 2023, 5:13 AM.



In order to allow targets to disable interleaving for scalable vectors, pass the entire VF's ElementCount to getMaxInterleaveFactor.
This is based off of the approach used here:

The plan would then be to disable interleaving on scalable VFs on RISC-V in a follow up patch.

Diff Detail

Event Timeline

luke created this revision.Feb 21 2023, 5:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2023, 5:13 AM
luke requested review of this revision.Feb 21 2023, 5:13 AM
luke edited the summary of this revision. (Show Details)Feb 21 2023, 5:15 AM
luke added inline comments.Feb 21 2023, 5:18 AM

Is there a policy on breaking API changes? If the old signature needs to be preserved we can overload as done in

fhahn added a subscriber: fhahn.Feb 21 2023, 5:22 AM
fhahn added inline comments.

We generally don't provide stability guarantees for the C++ API, so this should be fine.


Shouldn't that be VF.isScalar()?

luke added inline comments.Feb 21 2023, 6:04 AM

I plan on doing this in a follow up patch to keep this one NFC.
Disabling interleaving for scalable vectors changes a good few RISC-V test cases

luke updated this revision to Diff 499140.Feb 21 2023, 6:06 AM

Update ARM

reames accepted this revision.Feb 21 2023, 8:06 AM

LGTM. Seems like a valuable API cleanup if nothing else, and the goal makes sense as well.

This revision is now accepted and ready to land.Feb 21 2023, 8:06 AM
This revision was automatically updated to reflect the committed changes.