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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 8 14:21:51 PST 2026


================
@@ -123,6 +126,33 @@ class UnrollState {
 };
 } // namespace
 
+void UnrollState::addStartIndexForScalarSteps(VPScalarIVStepsRecipe *Steps,
+                                              unsigned Part) {
+  if (Part == 0) {
+    Steps->addOperand(getConstantInt(Part));
+    return;
+  }
+
+  VPBuilder Builder(Steps);
+  Type *BaseIVTy = TypeInfo.inferScalarType(Steps->getOperand(0));
+  Type *IntStepTy =
+      IntegerType::get(BaseIVTy->getContext(), BaseIVTy->getScalarSizeInBits());
+  VPValue *StartIdx0 = Steps->getOperand(2);
----------------
fhahn wrote:

I renamed the variable to StartIndex as it gets transformed by susequent operations, added getVFValue() to clarify the meaning of the operand

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


More information about the llvm-commits mailing list