[llvm] [VPlan] Replace UnrollPart for VPScalarIVSteps with start index op (NFC) (PR #170906)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 21 04:02:34 PST 2026


================
@@ -322,6 +322,17 @@ class VPBuilder {
     return createScalarCast(CastOp, Op, ResultTy, DL);
   }
 
+  VPValue *createScalarSExtOrTrunc(VPValue *Op, Type *ResultTy, Type *SrcTy,
+                                   DebugLoc DL) {
+    if (ResultTy == SrcTy)
+      return Op;
----------------
fhahn wrote:

The type arguments could be `IntegerType`, but it makes it slightly more cumbersome to use because `inferScalarType` always returns `Type *`.

The ResultTy == SrcTy is also there for convenience, to avoid creating incorrect casts (and not requiring the caller to check)

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


More information about the llvm-commits mailing list