[llvm] [VPlan] Support VPWidenIntOrFpInductionRecipes with EVL tail folding (PR #144666)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 20 03:02:40 PDT 2025
================
@@ -2604,14 +2605,19 @@ expandVPWidenIntOrFpInduction(VPWidenIntOrFpInductionRecipe *WidenIVR,
Inc = SplatVF;
Prev = WidenIVR->getLastUnrolledPartOperand();
} else {
+ if (VPRecipeBase *R = VF->getDefiningRecipe())
+ Builder.setInsertPoint(R->getParent(), std::next(R->getIterator()));
+ Type *VFTy = TypeInfo.inferScalarType(VF);
// Multiply the vectorization factor by the step using integer or
// floating-point arithmetic as appropriate.
if (StepTy->isFloatingPointTy())
VF = Builder.createScalarCast(Instruction::CastOps::UIToFP, VF, StepTy,
DL);
- else
+ else if (VFTy->getScalarSizeInBits() > StepTy->getScalarSizeInBits())
VF =
Builder.createScalarCast(Instruction::CastOps::Trunc, VF, StepTy, DL);
+ else if (VFTy->getScalarSizeInBits() < StepTy->getScalarSizeInBits())
+ VF = Builder.createScalarCast(Instruction::CastOps::ZExt, VF, StepTy, DL);
----------------
lukel97 wrote:
Done in b3c55e2af0f4ff77a75e411600dddf04ffb21708, but we can't use it for the start + step since we only want to truncate, not extend
https://github.com/llvm/llvm-project/pull/144666
More information about the llvm-commits
mailing list