diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2012-08-01 09:14:36 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2012-08-01 09:14:36 +0000 |
| commit | fb78083b1cf696dd3e9264dfe89e99451c62c60d (patch) | |
| tree | 5e4745f95b0c1f704c794e776c3e90c5fc9c6655 /llvm/test/Analysis/ScalarEvolution | |
| parent | 8c9a6bcae6114a4682ea90fedb87397fa08ea0f4 (diff) | |
| download | bcm5719-llvm-fb78083b1cf696dd3e9264dfe89e99451c62c60d.tar.gz bcm5719-llvm-fb78083b1cf696dd3e9264dfe89e99451c62c60d.zip | |
Stay rational; don't assert trying to take the square root of a negative value.
If it's negative, the loop is already proven to be infinite. Fixes PR13489!
llvm-svn: 161107
Diffstat (limited to 'llvm/test/Analysis/ScalarEvolution')
| -rw-r--r-- | llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll b/llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll index 06f1b6fe33a..e946d7a64bc 100644 --- a/llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll +++ b/llvm/test/Analysis/ScalarEvolution/SolveQuadraticEquation.ll @@ -80,3 +80,24 @@ for.cond539.preheader: unreachable } ; CHECK: Determining loop execution counts for: @test3 + +; PR13489 +; We used to crash on this too. + +define void @test4() { +entry: + br label %for.body + +for.body: ; preds = %for.body, %entry + %v2.02 = phi i64 [ 2, %entry ], [ %phitmp, %for.body ] + %v1.01 = phi i64 [ -2, %entry ], [ %sub1, %for.body ] + %sub1 = sub i64 %v1.01, %v2.02 + %phitmp = add i64 %v2.02, 2 + %tobool = icmp eq i64 %sub1, %phitmp + br i1 %tobool, label %for.end, label %for.body + +for.end: ; preds = %for.body + ret void +} + +; CHECK: Determining loop execution counts for: @test4 |

