[llvm] [VPlan] Move call widening decision to VPlan. (NFCI) (PR #195518)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 08:30:21 PDT 2026


================
@@ -1973,12 +1984,11 @@ static InstructionCost getCostForIntrinsics(Intrinsic::ID ID,
   }
 
   Type *RetTy = VF.isVector() ? toVectorizedTy(ScalarRetTy, VF) : ScalarRetTy;
-  SmallVector<Type *> ParamTys;
-  for (const VPValue *Op : Operands) {
-    ParamTys.push_back(VF.isVector()
-                           ? toVectorTy(Ctx.Types.inferScalarType(Op), VF)
-                           : Ctx.Types.inferScalarType(Op));
-  }
+  SmallVector<Type *> ParamTys =
+      map_to_vector(Operands, [&](const VPValue *Op) {
+        Type *Ty = Ctx.Types.inferScalarType(Op);
+        return VF.isVector() ? toVectorTy(Ty, VF) : Ty;
+      });
----------------
artagnon wrote:

I think toVectorTy automatically returns a scalar on scalar VF?

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


More information about the llvm-commits mailing list