We can only scalarize memory accesses if we know the index is valid.
This patch adjusts canScalarizeAcceess to fall back to
computeConstantRange to check if the index is known to be valid.
Paths
| Differential D102476
[VectorCombine] Use constant range info for index scalarization legality. ClosedPublic Authored by fhahn on May 14 2021, 3:32 AM.
Details Summary We can only scalarize memory accesses if we know the index is valid. This patch adjusts canScalarizeAcceess to fall back to
Diff Detail
Event Timelinefhahn added a parent revision: D100273: [VectorCombine] Scalarize vector load/extract..May 14 2021, 3:42 AM fhahn added a child revision: D102496: [Passes] Run vector-combine early with -fenable-matrix..May 14 2021, 6:51 AM Comment Actions This patch looks good if we want to go with the poison-on-OOB semantics. Comment Actions
I think the conclusion of the discussion at the patch to far seems to be to keep it poison. So I think we could move ahead with this patch? Comment Actions
SGTM! This revision is now accepted and ready to land.May 25 2021, 4:01 AM Closed by commit rG575e2aff5574: [VectorCombine] Use constant range info for index scalarization legality. (authored by fhahn). · Explain WhyMay 25 2021, 5:59 AM This revision was automatically updated to reflect the committed changes.
fhahn added inline comments.
Revision Contents
Diff 347367 llvm/lib/Transforms/Vectorize/VectorCombine.cpp
llvm/test/Transforms/PhaseOrdering/AArch64/matrix-extract-insert.ll
llvm/test/Transforms/VectorCombine/AArch64/load-extractelement-scalarization.ll
llvm/test/Transforms/VectorCombine/load-insert-store.ll
|
Alive doesn't like this: https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=50de39e1c7237e13&test=Transforms%2FVectorCombine%2Fload-insert-store.ll