[llvm] [VPlan] Use VPInstructionWithType for uniform casts. (PR #140623)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 9 06:16:23 PDT 2025
================
@@ -1031,8 +1031,15 @@ static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
unsigned ExtOpcode = match(R.getOperand(0), m_SExt(m_VPValue()))
? Instruction::SExt
: Instruction::ZExt;
- auto *VPC =
- new VPWidenCastRecipe(Instruction::CastOps(ExtOpcode), A, TruncTy);
+ VPSingleDefRecipe *VPC;
+ if (vputils::isSingleScalar(Def))
----------------
ayalz wrote:
Note that this asks if a VPSingleDefRecipe Def is single scalar, where Def (not being a VPInstruction) does not record its own IsSingleScalar, defaulting to vputils function to figure it out.
Can VPWidenCastRecipe be folded into VPInstructionWithType, making the latter single-scalar agnostic?
https://github.com/llvm/llvm-project/pull/140623
More information about the llvm-commits
mailing list