[llvm] [VPlan] Preserve underlying value when EVL transforming intrinsics/casts (PR #121552)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 6 05:59:52 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());
----------------
lukel97 wrote:
I think that just does the same thing if CR->getUnderlyingValue() is null. Happy to add it if people prefer it stylistically though
https://github.com/llvm/llvm-project/pull/121552
More information about the llvm-commits
mailing list