llvm-project/llvm/test/Transforms/LoopSimplify
Max Kazantsev 7094c8deb2 [SCEV] Make exact taken count calculation more optimistic
Currently, `getExact` fails if it sees two exit counts in different blocks. There is
no solid reason to do so, given that we only calculate exact non-taken count
for exiting blocks that dominate latch. Using this fact, we can simply take min
out of all exits of all blocks to get the exact taken count.

This patch makes the calculation more optimistic with enforcing our assumption
with asserts. It allows us to calculate exact backedge taken count in trivial loops
like

  for (int i = 0; i < 100; i++) {
    if (i > 50) break;
    . . .
  }

Differential Revision: https://reviews.llvm.org/D44676
Reviewed By: fhahn

llvm-svn: 328611
2018-03-27 07:30:38 +00:00
..
2003-04-25-AssertFail.ll
2003-05-12-PreheaderExitOfChild.ll
2003-08-15-PreheadersFail.ll
2003-12-10-ExitBlocksProblem.ll
2004-02-05-DominatorInfoCorruption.ll
2004-03-15-IncorrectDomUpdate.ll
2004-04-01-IncorrectDomUpdate.ll
2004-04-12-LoopSimplify-SwitchBackedges.ll
2004-04-13-LoopSimplifyUpdateDomFrontier.ll
2007-10-28-InvokeCrash.ll
2010-07-15-IncorrectDomFrontierUpdate.ll
2010-12-26-PHIInfiniteLoop.ll
2011-12-14-LandingpadHeader.ll
2012-03-20-indirectbr.ll
ashr-crash.ll
basictest.ll
dbg-loc.ll Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
dup-preds.ll
hardertest.ll
indirectbr-backedge.ll
indirectbr.ll
merge-exits.ll
notify-scev.ll
phi-node-simplify.ll
pr26682.ll
pr28272.ll
pr30454.ll
pr33494.ll [SCEV] Do not visit nodes twice in containsConstantSomewhere 2017-07-28 06:42:15 +00:00
preserve-llvm-loop-metadata.ll
preserve-scev.ll [SCEV] Make exact taken count calculation more optimistic 2018-03-27 07:30:38 +00:00
single-backedge.ll
unreachable-loop-pred.ll [BasicBlockUtils] Check for unreachable preds before updating LI in UpdateAnalysisInformation 2018-01-02 16:25:50 +00:00