Skip to content
Snippets Groups Projects
Commit f82f39b9 authored by Philip Reames's avatar Philip Reames
Browse files

[SCEV] Add a comment about invariant in howManyLessThans

parent c7b3a910
No related branches found
No related tags found
No related merge requests found
......@@ -11728,6 +11728,15 @@ ScalarEvolution::howManyLessThans(const SCEV *LHS, const SCEV *RHS,
return getCouldNotCompute();
}
 
// On all paths just preceeding, we established the following invariant:
// IV can be assumed not to overflow up to and including the exiting
// iteration. We proved this in one of two ways:
// 1) We can show overflow doesn't occur before the exiting iteration
// 1a) canIVOverflowOnLT, and b) step of one
// 2) We can show that if overflow occurs, the loop must execute UB
// before any possible exit.
// Note that we have not yet proved RHS invariant (in general).
const SCEV *Start = IV->getStart();
 
// Preserve pointer-typed Start/RHS to pass to isLoopEntryGuardedByCond.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment