Skip to content

Commit 6517c5b

Browse files
committed
[LV][NFC]Address last comments from #88025.
1 parent 3fffe6c commit 6517c5b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9427,6 +9427,8 @@ void VPWidenLoadRecipe::execute(VPTransformState &State) {
94279427
}
94289428
}
94299429

9430+
/// Use all-true mask for reverse rather than actual mask, as it avoids a
9431+
/// dependence w/o affecting the result.
94309432
static Instruction *createReverseEVL(IRBuilderBase &Builder, Value *Operand,
94319433
Value *EVL, const Twine &Name) {
94329434
VectorType *ValTy = cast<VectorType>(Operand->getType());
@@ -9474,11 +9476,8 @@ void VPWidenLoadEVLRecipe::execute(VPTransformState &State) {
94749476
0, Attribute::getWithAlignment(NewLI->getContext(), Alignment));
94759477
State.addMetadata(NewLI, LI);
94769478
Instruction *Res = NewLI;
9477-
if (isReverse()) {
9478-
// Use cheap all-true mask for reverse rather than actual mask, it does not
9479-
// affect the result.
9479+
if (isReverse())
94809480
Res = createReverseEVL(Builder, Res, EVL, "vp.reverse");
9481-
}
94829481
State.set(this, Res, 0);
94839482
}
94849483

@@ -9537,11 +9536,8 @@ void VPWidenStoreEVLRecipe::execute(VPTransformState &State) {
95379536
CallInst *NewSI = nullptr;
95389537
Value *StoredVal = State.get(StoredValue, 0);
95399538
Value *EVL = State.get(getEVL(), VPIteration(0, 0));
9540-
if (isReverse()) {
9541-
// Use cheap all-true mask for reverse rather than actual mask, it does not
9542-
// affect the result.
9539+
if (isReverse())
95439540
StoredVal = createReverseEVL(Builder, StoredVal, EVL, "vp.reverse");
9544-
}
95459541
Value *Mask = nullptr;
95469542
if (VPValue *VPMask = getMask()) {
95479543
Mask = State.get(VPMask, 0);

0 commit comments

Comments
 (0)