From f2336d4c7e5b2264ae97e5e01d69fe1a6a3c2a4a Mon Sep 17 00:00:00 2001 From: Alex Bradbury Date: Fri, 14 Nov 2025 16:11:48 +0000 Subject: Revert "[VPlan] Expand WidenInt inductions with nuw/nsw" (#168080) Reverts llvm/llvm-project#163538 This is causing build failures on the two-stage RVV buildbots. e.g. https://lab.llvm.org/buildbot/#/builders/214/builds/1363. I've shared a reproducer and more information at https://github.com/llvm/llvm-project/pull/163538#issuecomment-3533482822 This reverts commit 355e0f94af5adabe90ac57110ce1b47596afd4cd. --- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp') diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 89893af5c114..58fcab40d589 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -7639,10 +7639,6 @@ createWidenInductionRecipes(VPInstruction *PhiR, assert(Plan.getLiveIn(IndDesc.getStartValue()) == Start && "Start VPValue must match IndDesc's start value"); - // It is always safe to copy over the NoWrap and FastMath flags. In - // particular, when folding tail by masking, the masked-off lanes are never - // used, so it is safe. - VPIRFlags Flags = vputils::getFlagsFromIndDesc(IndDesc); VPValue *Step = vputils::getOrCreateVPValueForSCEVExpr(Plan, IndDesc.getStep()); @@ -7655,7 +7651,7 @@ createWidenInductionRecipes(VPInstruction *PhiR, PHINode *Phi = cast(PhiR->getUnderlyingInstr()); return new VPWidenIntOrFpInductionRecipe(Phi, Start, Step, &Plan.getVF(), - IndDesc, Flags, PhiR->getDebugLoc()); + IndDesc, PhiR->getDebugLoc()); } VPHeaderPHIRecipe * @@ -7709,15 +7705,10 @@ VPRecipeBuilder::tryToOptimizeInductionTruncate(VPInstruction *VPI, PHINode *Phi = WidenIV->getPHINode(); VPValue *Start = WidenIV->getStartValue(); const InductionDescriptor &IndDesc = WidenIV->getInductionDescriptor(); - - // It is always safe to copy over the NoWrap and FastMath flags. In - // particular, when folding tail by masking, the masked-off lanes are never - // used, so it is safe. - VPIRFlags Flags = vputils::getFlagsFromIndDesc(IndDesc); VPValue *Step = vputils::getOrCreateVPValueForSCEVExpr(Plan, IndDesc.getStep()); - return new VPWidenIntOrFpInductionRecipe( - Phi, Start, Step, &Plan.getVF(), IndDesc, I, Flags, VPI->getDebugLoc()); + return new VPWidenIntOrFpInductionRecipe(Phi, Start, Step, &Plan.getVF(), + IndDesc, I, VPI->getDebugLoc()); } VPSingleDefRecipe *VPRecipeBuilder::tryToWidenCall(VPInstruction *VPI, -- cgit v1.2.3