[llvm] e122380 - [LV] Use VPBuilder to create Select (NFCI).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon May 13 12:44:50 PDT 2024
Author: Florian Hahn
Date: 2024-05-13T20:44:39+01:00
New Revision: e1223804458a99f82dc110d41647410bdac420df
URL: https://github.com/llvm/llvm-project/commit/e1223804458a99f82dc110d41647410bdac420df
DIFF: https://github.com/llvm/llvm-project/commit/e1223804458a99f82dc110d41647410bdac420df.diff
LOG: [LV] Use VPBuilder to create Select (NFCI).
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 261933966b74b..8b4cb5a6658d7 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -8377,10 +8377,7 @@ VPWidenRecipe *VPRecipeBuilder::tryToWiden(Instruction *I,
VPValue *Mask = getBlockInMask(I->getParent());
VPValue *One =
Plan.getOrAddLiveIn(ConstantInt::get(I->getType(), 1u, false));
- auto *SafeRHS =
- new VPInstruction(Instruction::Select, {Mask, Ops[1], One},
- I->getDebugLoc());
- VPBB->appendRecipe(SafeRHS);
+ auto *SafeRHS = Builder.createSelect(Mask, Ops[1], One, I->getDebugLoc());
Ops[1] = SafeRHS;
return new VPWidenRecipe(*I, make_range(Ops.begin(), Ops.end()));
}
More information about the llvm-commits
mailing list