[llvm] [VPlan] Preserve underlying value when EVL transforming intrinsics/casts (PR #121552)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 6 05:47:04 PST 2025
================
@@ -1506,8 +1506,12 @@ static VPRecipeBase *createEVLRecipe(VPValue *HeaderMask,
SmallVector<VPValue *> Ops(CR->operands());
Ops.push_back(&AllOneMask);
Ops.push_back(&EVL);
- return new VPWidenIntrinsicRecipe(
+ auto *VPR = new VPWidenIntrinsicRecipe(
VPID, Ops, TypeInfo.inferScalarType(CR), CR->getDebugLoc());
+ // Preserve the underlying value as some cast instructions may have
+ // their cost skipped in collectValuesToIgnore
+ VPR->setUnderlyingValue(CR->getUnderlyingValue());
----------------
alexey-bataev wrote:
I think he suggestion something like this:
```
if (CR->getUnderlingValue())
VPR->setUnderlyingValue(CR->getUnderlyingValue());
```
https://github.com/llvm/llvm-project/pull/121552
More information about the llvm-commits
mailing list