Skip to content

Commit 2a9aed1

Browse files
committed
[LV] Retain mask-reversal comment as suggested after e5e71af.
Address post-commit comment to retain comment.
1 parent 20f544d commit 2a9aed1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9561,13 +9561,16 @@ void VPWidenMemoryInstructionRecipe::execute(VPTransformState &State) {
95619561
auto &Builder = State.Builder;
95629562
InnerLoopVectorizer::VectorParts BlockInMaskParts(State.UF);
95639563
bool isMaskRequired = getMask();
9564-
if (isMaskRequired)
9564+
if (isMaskRequired) {
9565+
// Mask reversal is only neede for non-all-one (null) masks, as reverse of a
9566+
// null all-one mask is a null mask.
95659567
for (unsigned Part = 0; Part < State.UF; ++Part) {
95669568
Value *Mask = State.get(getMask(), Part);
95679569
if (isReverse())
95689570
Mask = Builder.CreateVectorReverse(Mask, "reverse");
95699571
BlockInMaskParts[Part] = Mask;
95709572
}
9573+
}
95719574

95729575
const auto CreateVecPtr = [&](unsigned Part, Value *Ptr) -> Value * {
95739576
// Calculate the pointer for the specific unroll-part.

0 commit comments

Comments
 (0)