diff options
| author | Florian Hahn <florian.hahn@arm.com> | 2018-03-23 12:49:39 +0000 |
|---|---|---|
| committer | Florian Hahn <florian.hahn@arm.com> | 2018-03-23 12:49:39 +0000 |
| commit | f73c3ece7f1004dd5c1b8351a90172258018dd12 (patch) | |
| tree | 19e273371f02825a384efe9b1cad5b2918576634 /llvm/test | |
| parent | f54235594222ed8925429e050d0b7611b2c249a4 (diff) | |
| download | bcm5719-llvm-f73c3ece7f1004dd5c1b8351a90172258018dd12.tar.gz bcm5719-llvm-f73c3ece7f1004dd5c1b8351a90172258018dd12.zip | |
Revert r328307: [IPSCCP] Use constant range information for comparisons of parameters.
Reverted for now, due to it causing verifier failures.
llvm-svn: 328312
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/SCCP/ip-constant-ranges.ll | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/llvm/test/Transforms/SCCP/ip-constant-ranges.ll b/llvm/test/Transforms/SCCP/ip-constant-ranges.ll index d5a3e208adf..22a239d1208 100644 --- a/llvm/test/Transforms/SCCP/ip-constant-ranges.ll +++ b/llvm/test/Transforms/SCCP/ip-constant-ranges.ll @@ -2,7 +2,11 @@ ; Constant range for %a is [1, 48) and for %b is [301, 1000) ; CHECK-LABEL: f1 -; CHECK: ret i32 undef +; CHECK-NOT: icmp +; CHECK: %a.1 = select i1 false, i32 1, i32 2 +; CHECK: %b.1 = select i1 true, i32 1, i32 2 +; CHECK: %a.2 = select i1 false, i32 1, i32 2 +; CHECK: %b.2 = select i1 true, i32 1, i32 2 define internal i32 @f1(i32 %a, i32 %b) { entry: %cmp.a = icmp sgt i32 %a, 300 @@ -24,11 +28,10 @@ entry: ; CHECK-LABEL: f2 ; CHECK: %cmp = icmp sgt i32 %x, 300 ; CHECK: %res1 = select i1 %cmp, i32 1, i32 2 +; CHECK-NEXT: %res2 = select i1 true, i32 3, i32 4 +; CHECK-NEXT: %res3 = select i1 true, i32 5, i32 6 ; CHECK-NEXT: %res4 = select i1 %cmp4, i32 3, i32 4 -; CHECK-NEXT: %res6 = add i32 %res1, 3 -; CHECK-NEXT: %res7 = add i32 5, %res4 -; CHECK-NEXT: %res = add i32 %res6, 5 -; CHECK-NEXT: ret i32 %res +; CHECK-NEXT: %res5 = select i1 true, i32 5, i32 6 define internal i32 @f2(i32 %x) { entry: %cmp = icmp sgt i32 %x, 300 @@ -54,7 +57,8 @@ entry: %call2 = tail call i32 @f1(i32 47, i32 999) %call3 = tail call i32 @f2(i32 47) %call4 = tail call i32 @f2(i32 301) - %res.1 = add nsw i32 12, %call3 + %res = add nsw i32 %call1, %call2 + %res.1 = add nsw i32 %res, %call3 %res.2 = add nsw i32 %res.1, %call4 ret i32 %res.2 } @@ -141,9 +145,9 @@ define double @test_struct({ double, double } %test) { ; Constant range for %x is [47, 302) ; CHECK-LABEL: @f5 ; CHECK-NEXT: entry: -; CHECK-NEXT: %cmp = icmp sgt i32 %x, undef -; CHECK-NEXT: %res1 = select i1 %cmp, i32 1, i32 2 -; CHECK-NEXT: %res = add i32 %res1, 3 +; CHECK-NEXT: %res1 = select i1 undef, i32 1, i32 2 +; CHECK-NEXT: %res2 = select i1 undef, i32 3, i32 4 +; CHECK-NEXT: %res = add i32 %res1, %res2 ; CHECK-NEXT: ret i32 %res define internal i32 @f5(i32 %x) { entry: |

