This is an archive of the discontinued LLVM Phabricator instance.

[LV][NFC] Use ElementCount for getMaxInterleaveFactor
ClosedPublic

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

Details

Summary

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: https://repo.hca.bsc.es/gitlab/rferrer/llvm-epi/-/commit/8d36708507b3c378078b9fe364bc548354aaec86

The plan would then be to disable interleaving on scalable VFs on RISC-V in a follow up patch.
See https://reviews.llvm.org/D143723#4132349

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
llvm/include/llvm/Analysis/TargetTransformInfo.h
1099

Is there a policy on breaking API changes? If the old signature needs to be preserved we can overload as done in https://repo.hca.bsc.es/gitlab/rferrer/llvm-epi/-/commit/8d36708507b3c378078b9fe364bc548354aaec86

fhahn added a subscriber: fhahn.Feb 21 2023, 5:22 AM
fhahn added inline comments.
llvm/include/llvm/Analysis/TargetTransformInfo.h
1099

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

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
276

Shouldn't that be VF.isScalar()?

luke added inline comments.Feb 21 2023, 6:04 AM
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
276

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.