File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -9200,9 +9200,13 @@ ScalarEvolution::ExitLimit ScalarEvolution::computeExitLimitFromICmp(
9200
9200
if (!EnableFiniteLoopControl || !ControllingFiniteLoop ||
9201
9201
!isLoopInvariant(RHS, L)) {
9202
9202
// Otherwise, perform the addition in a wider type, to avoid overflow.
9203
+ // If the LHS is an addrec with the appropriate nowrap flag, the
9204
+ // extension will be sunk into it and the exit count can be analyzed.
9203
9205
auto *OldType = dyn_cast<IntegerType>(LHS->getType());
9204
9206
if (!OldType)
9205
9207
break;
9208
+ // Prefer doubling the bitwidth over adding a single bit to make it more
9209
+ // likely that we use a legal type.
9206
9210
auto *NewType =
9207
9211
Type::getIntNTy(OldType->getContext(), OldType->getBitWidth() * 2);
9208
9212
if (ICmpInst::isSigned(Pred)) {
You can’t perform that action at this time.
0 commit comments