[llvm] [VPlan] Use VPWidenIntrinsicRecipe to vp.select. (PR #110489)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 14 05:39:03 PDT 2024
================
@@ -1383,6 +1385,15 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
VPValue *NewMask = GetNewMask(Red->getCondOp());
return new VPReductionEVLRecipe(*Red, EVL, NewMask);
})
+ .Case<VPWidenSelectRecipe>([&](VPWidenSelectRecipe *Sel) {
+ SmallVector<VPValue *> Ops(Sel->operands());
+ Ops.push_back(&EVL);
+ return new VPWidenIntrinsicRecipe(
----------------
fhahn wrote:
Looking at https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp#L1132, `vp_select` should match `SelectInst`'s cost.
There may be an edge-case where the condition is considered scalar (https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp#L6631), but this shouldn't apply to `vp_select` and the VPlan cost would be more accurate. We may have to consider if EVL will be applied in the legacy cost computation if that indeed becomes an issue.
https://github.com/llvm/llvm-project/pull/110489
More information about the llvm-commits
mailing list