diff options
| author | Florian Hahn <flo@fhahn.com> | 2026-02-11 20:52:07 +0000 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2026-02-11 20:52:08 +0000 |
| commit | d3afa171ee236dfef4b7cd4b4dd0b0fb165a48cc (patch) | |
| tree | 299e5537957762ff41d490adb3a6f322d73a6d79 /llvm/lib/Transforms/Vectorize | |
| parent | 0215f6b6cf810d9ab6d02fc7bbec5c26ad4701ff (diff) | |
| download | llvm-d3afa171ee236dfef4b7cd4b4dd0b0fb165a48cc.tar.gz llvm-d3afa171ee236dfef4b7cd4b4dd0b0fb165a48cc.tar.bz2 llvm-d3afa171ee236dfef4b7cd4b4dd0b0fb165a48cc.zip | |
[LV] Don't scalarize loads that need predication in legacy CM.
The legacy cost model tries to scalarize loads that are used as
pointers. Skip if the load would need predicating when scalarized,
because that would incur very high costs, see useEmulatedMaskMemRefHack.
Fixes https://github.com/llvm/llvm-project/issues/180780.
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 164d74f1a440..9b2641c2b9bb 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -5883,9 +5883,9 @@ void LoopVectorizationCostModel::setCostBasedWideningDecision(ElementCount VF) { // if the loaded register is involved in an address computation, it is // instead changed here when we know this is the case. InstWidening Decision = getWideningDecision(I, VF); - if (Decision == CM_Widen || Decision == CM_Widen_Reverse || - (!isPredicatedInst(I) && !Legal->isUniformMemOp(*I, VF) && - Decision == CM_Scalarize)) { + if (!isPredicatedInst(I) && + (Decision == CM_Widen || Decision == CM_Widen_Reverse || + (!Legal->isUniformMemOp(*I, VF) && Decision == CM_Scalarize))) { // Scalarize a widened load of address or update the cost of a scalar // load of an address. setWideningDecision( |
