diff options
author | Dan Gohman <gohman@apple.com> | 2009-06-21 23:46:38 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-06-21 23:46:38 +0000 |
commit | d2b62c4bf59df3127ff1a13f24c33ddbac09ba43 (patch) | |
tree | d9190de286f8fd9ad559821d01fc525efee93146 /test | |
parent | f6611855489bb3cee46233780b55005ddd399471 (diff) | |
download | external_llvm-d2b62c4bf59df3127ff1a13f24c33ddbac09ba43.zip external_llvm-d2b62c4bf59df3127ff1a13f24c33ddbac09ba43.tar.gz external_llvm-d2b62c4bf59df3127ff1a13f24c33ddbac09ba43.tar.bz2 |
Fix ScalarEvolution's backedge-taken count computations to check for
overflow when computing a integer division to round up.
Thanks to Nick Lewycky for noticing this!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll | 7 | ||||
-rw-r--r-- | test/Analysis/ScalarEvolution/trip-count3.ll | 6 | ||||
-rw-r--r-- | test/Transforms/IndVarSimplify/loop_evaluate_6.ll | 6 |
3 files changed, 15 insertions, 4 deletions
diff --git a/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll b/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll index fc6bbb1..8fb1604 100644 --- a/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll +++ b/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll @@ -1,4 +1,9 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output |& grep {/u 3} +; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ +; RUN: | grep {Loop bb: Unpredictable backedge-taken count\\.} + +; ScalarEvolution can't compute a trip count because it doesn't know if +; dividing by the stride will have a remainder. This could theoretically +; be teaching it how to use a more elaborate trip count computation. define i32 @f(i32 %x) nounwind readnone { entry: diff --git a/test/Analysis/ScalarEvolution/trip-count3.ll b/test/Analysis/ScalarEvolution/trip-count3.ll index a95138f..35c8683 100644 --- a/test/Analysis/ScalarEvolution/trip-count3.ll +++ b/test/Analysis/ScalarEvolution/trip-count3.ll @@ -1,5 +1,9 @@ ; RUN: llvm-as < %s | opt -scalar-evolution -analyze -disable-output \ -; RUN: | grep {backedge-taken count is ((64 + (-64 smax (-1 + (-1 \\* %0))) + %0) /u 64)} +; RUN: | grep {Loop bb3\\.i: Unpredictable backedge-taken count\\.} + +; ScalarEvolution can't compute a trip count because it doesn't know if +; dividing by the stride will have a remainder. This could theoretically +; be teaching it how to use a more elaborate trip count computation. 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-unknown-linux-gnu" diff --git a/test/Transforms/IndVarSimplify/loop_evaluate_6.ll b/test/Transforms/IndVarSimplify/loop_evaluate_6.ll index 35fbf52..0d17a80 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate_6.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate_6.ll @@ -1,7 +1,9 @@ ; RUN: llvm-as < %s | opt -indvars -loop-deletion | llvm-dis | grep phi | count 1 +; XFAIL: * -; Indvars should be able to evaluate this loop, allowing loop deletion -; to delete it. +; Indvars can't evaluate this loop, because ScalarEvolution can't compute +; an exact trip count, because it doesn't know if dividing by the stride will +; have a remainder. It could be done with more aggressive VRP though. define i32 @test(i32 %x_offs) nounwind readnone { entry: |