diff options
author | Florian Hahn <flo@fhahn.com> | 2023-11-18 20:53:20 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2023-11-18 20:53:23 +0000 |
commit | 2a9aed17302c8363883a228d35f398110b575db3 (patch) | |
tree | a513f38ae57b9b9971f63c30d227f0645139f51a | |
parent | 20f544d047e34283884d09e24db400de5077487f (diff) |
[LV] Retain mask-reversal comment as suggested after e5e71af.
Address post-commit comment to retain comment.
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 3b41939246b9..295e25969663 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -9561,13 +9561,16 @@ void VPWidenMemoryInstructionRecipe::execute(VPTransformState &State) { auto &Builder = State.Builder; InnerLoopVectorizer::VectorParts BlockInMaskParts(State.UF); bool isMaskRequired = getMask(); - if (isMaskRequired) + if (isMaskRequired) { + // Mask reversal is only neede for non-all-one (null) masks, as reverse of a + // null all-one mask is a null mask. for (unsigned Part = 0; Part < State.UF; ++Part) { Value *Mask = State.get(getMask(), Part); if (isReverse()) Mask = Builder.CreateVectorReverse(Mask, "reverse"); BlockInMaskParts[Part] = Mask; } + } const auto CreateVecPtr = [&](unsigned Part, Value *Ptr) -> Value * { // Calculate the pointer for the specific unroll-part. |