File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -4790,14 +4790,14 @@ VectorizationFactor LoopVectorizationPlanner::selectEpilogueVectorizationFactor(
47904790 " Trip count SCEV must be computable" );
47914791 RemainingIterations = SE.getURemExpr (
47924792 TC, SE.getConstant (TCType, MainLoopVF.getKnownMinValue () * IC));
4793- const APInt MaxRemainingIterations =
4794- SE.getUnsignedRangeMax (RemainingIterations);
4795- // Guard against huge trip counts.
4796- if (MaxRemainingIterations.getActiveBits () <= 32 ) {
4797- MaxTripCount = MaxRemainingIterations.getZExtValue ();
4798- LLVM_DEBUG (dbgs () << " LEV: Maximum Trip Count for Epilogue: "
4799- << MaxTripCount << " \n " );
4793+ MaxTripCount = MainLoopVF.getKnownMinValue () * IC - 1 ;
4794+ if (SE.isKnownPredicate (CmpInst::ICMP_ULT, RemainingIterations,
4795+ SE.getConstant (TCType, MaxTripCount))) {
4796+ MaxTripCount =
4797+ SE.getUnsignedRangeMax (RemainingIterations).getZExtValue ();
48004798 }
4799+ LLVM_DEBUG (dbgs () << " LEV: Maximum Trip Count for Epilogue: "
4800+ << MaxTripCount << " \n " );
48014801 }
48024802 if (SE.isKnownPredicate (
48034803 CmpInst::ICMP_UGT,
You can’t perform that action at this time.
0 commit comments