diff options
| author | Max Kazantsev <max.kazantsev@azul.com> | 2018-03-27 07:30:38 +0000 |
|---|---|---|
| committer | Max Kazantsev <max.kazantsev@azul.com> | 2018-03-27 07:30:38 +0000 |
| commit | 7094c8deb2b2bc0a5a4b79f5a5cc195bf4e1d5ca (patch) | |
| tree | 70c5cdcf3057d66d3a4425049b150a98ad16a87b /llvm/test/Transforms/IndVarSimplify | |
| parent | 3ddeb33e0017209792e72b33dee1a0ba69b316f1 (diff) | |
| download | bcm5719-llvm-7094c8deb2b2bc0a5a4b79f5a5cc195bf4e1d5ca.tar.gz bcm5719-llvm-7094c8deb2b2bc0a5a4b79f5a5cc195bf4e1d5ca.zip | |
[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
Diffstat (limited to 'llvm/test/Transforms/IndVarSimplify')
| -rw-r--r-- | llvm/test/Transforms/IndVarSimplify/loop_evaluate10.ll | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/llvm/test/Transforms/IndVarSimplify/loop_evaluate10.ll b/llvm/test/Transforms/IndVarSimplify/loop_evaluate10.ll index 0739219fccd..3ac91060461 100644 --- a/llvm/test/Transforms/IndVarSimplify/loop_evaluate10.ll +++ b/llvm/test/Transforms/IndVarSimplify/loop_evaluate10.ll @@ -3,11 +3,6 @@ ; This loop has multiple exits, and the value of %b1 depends on which ; exit is taken. Indvars should correctly compute the exit values. ; -; XFAIL: * -; Indvars does not currently replace loop invariant values unless all -; loop exits have the same exit value. We could handle some cases, -; such as this, by making getSCEVAtScope() sensitive to a particular -; loop exit. See PR11388. target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" target triple = "x86_64-pc-linux-gnu" |

