diff options
| author | Pete Cooper <peter_cooper@apple.com> | 2011-12-01 19:13:26 +0000 |
|---|---|---|
| committer | Pete Cooper <peter_cooper@apple.com> | 2011-12-01 19:13:26 +0000 |
| commit | fdddc271433427ac32712e1880e03a94f1d4f782 (patch) | |
| tree | 8197b46ffa0782b4fa0f8f7ae5361069958ec7d7 /llvm/test/Transforms | |
| parent | d594bac68b3b9d3c896c3c4fab1ac63060dafa16 (diff) | |
| download | bcm5719-llvm-fdddc271433427ac32712e1880e03a94f1d4f782.tar.gz bcm5719-llvm-fdddc271433427ac32712e1880e03a94f1d4f782.zip | |
Improved fix for abs(val) != 0 to check other similar case. Also fixed style issues and confusing comment
llvm-svn: 145618
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/icmp.ll | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll index e3d12f7fff7..016e8c55fb3 100644 --- a/llvm/test/Transforms/InstCombine/icmp.ll +++ b/llvm/test/Transforms/InstCombine/icmp.ll @@ -561,12 +561,22 @@ define i1 @test57(i32 %a) { } ; rdar://problem/10482509 -; CHECK: @cmpabs +; CHECK: @cmpabs1 ; CHECK-NEXT: icmp ne -define zeroext i1 @cmpabs(i64 %val) { +define zeroext i1 @cmpabs1(i64 %val) { %sub = sub nsw i64 0, %val %cmp = icmp slt i64 %val, 0 %sub.val = select i1 %cmp, i64 %sub, i64 %val %tobool = icmp ne i64 %sub.val, 0 ret i1 %tobool } + +; CHECK: @cmpabs2 +; CHECK-NEXT: icmp ne +define zeroext i1 @cmpabs2(i64 %val) { + %sub = sub nsw i64 0, %val + %cmp = icmp slt i64 %val, 0 + %sub.val = select i1 %cmp, i64 %val, i64 %sub + %tobool = icmp ne i64 %sub.val, 0 + ret i1 %tobool +} |

