[llvm] [VPlan] Add VPInstruction::StepVector and use it in VPWidenIntOrFpInductionRecipe (PR #129508)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 28 07:03:08 PDT 2025


================
@@ -1902,15 +1911,6 @@ static Value *getStepVector(Value *Val, Value *Step,
 
   SmallVector<Constant *, 8> Indices;
 
-  // Create a vector of consecutive numbers from zero to VF.
-  VectorType *InitVecValVTy = ValVTy;
-  if (STy->isFloatingPointTy()) {
-    Type *InitVecValSTy =
-        IntegerType::get(STy->getContext(), STy->getScalarSizeInBits());
-    InitVecValVTy = VectorType::get(InitVecValSTy, VLen);
----------------
lukel97 wrote:

They might not always have the same type as step might be a float or an integer, whereas InitVec is always an integer. Hopefully the calls to `Builder.CreateMul(InitVec, Step)` in the integer case and `Builder.CreateUIToFP(InitVec, ValVTy)` in the float case will catch this. 

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


More information about the llvm-commits mailing list