[llvm] 6517c5b - [LV][NFC]Address last comments from https://github.com/llvm/llvm-project/pull/88025.
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Fri May 3 06:51:11 PDT 2024
Author: Alexey Bataev
Date: 2024-05-03T06:51:01-07:00
New Revision: 6517c5b068915784e3ae17ebce2c38e4072281dd
URL: https://github.com/llvm/llvm-project/commit/6517c5b068915784e3ae17ebce2c38e4072281dd
DIFF: https://github.com/llvm/llvm-project/commit/6517c5b068915784e3ae17ebce2c38e4072281dd.diff
LOG: [LV][NFC]Address last comments from https://github.com/llvm/llvm-project/pull/88025.
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 0b1b63800fcf5d..3be0102bea3e34 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -9427,6 +9427,8 @@ void VPWidenLoadRecipe::execute(VPTransformState &State) {
}
}
+/// Use all-true mask for reverse rather than actual mask, as it avoids a
+/// dependence w/o affecting the result.
static Instruction *createReverseEVL(IRBuilderBase &Builder, Value *Operand,
Value *EVL, const Twine &Name) {
VectorType *ValTy = cast<VectorType>(Operand->getType());
@@ -9474,11 +9476,8 @@ void VPWidenLoadEVLRecipe::execute(VPTransformState &State) {
0, Attribute::getWithAlignment(NewLI->getContext(), Alignment));
State.addMetadata(NewLI, LI);
Instruction *Res = NewLI;
- if (isReverse()) {
- // Use cheap all-true mask for reverse rather than actual mask, it does not
- // affect the result.
+ if (isReverse())
Res = createReverseEVL(Builder, Res, EVL, "vp.reverse");
- }
State.set(this, Res, 0);
}
@@ -9537,11 +9536,8 @@ void VPWidenStoreEVLRecipe::execute(VPTransformState &State) {
CallInst *NewSI = nullptr;
Value *StoredVal = State.get(StoredValue, 0);
Value *EVL = State.get(getEVL(), VPIteration(0, 0));
- if (isReverse()) {
- // Use cheap all-true mask for reverse rather than actual mask, it does not
- // affect the result.
+ if (isReverse())
StoredVal = createReverseEVL(Builder, StoredVal, EVL, "vp.reverse");
- }
Value *Mask = nullptr;
if (VPValue *VPMask = getMask()) {
Mask = State.get(VPMask, 0);
More information about the llvm-commits
mailing list