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

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 20 07:31:43 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;
----------------
ayalz wrote:

Somewhat independent: being both integer types (should the arguments be `IntegerType*`' rather than `Type*`?), if their scalar size in bits are the same then they should be the same Type, so it's redundant to also/instead bail out early if `ResultTy->getScalarSizeInBits() == SrcTy->getScalarSizeInBits()` - can assert they are distinct here, and above in createScalarZExtOrTrunc()?

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


More information about the llvm-commits mailing list