[llvm] [VPlan] Use VPInstructionWithType for uniform casts. (PR #140623)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 22 01:55:52 PDT 2025


================
@@ -1037,8 +1037,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))
+          VPC = new VPInstructionWithType(Instruction::CastOps(ExtOpcode), {A},
+                                          TruncTy, {}, {},
----------------
fhahn wrote:

Done, thanks

https://github.com/llvm/llvm-project/pull/140623


More information about the llvm-commits mailing list