aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/icmp-shr.ll
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-09-19 00:48:31 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-09-19 00:48:31 +0000
commitbdf4ccfe9b488e5413647774e7181f20d37ae238 (patch)
tree789652fa336d5b04e23d8b39c8f67396635e5444 /test/Transforms/InstCombine/icmp-shr.ll
parent1e4af0841002c55ed6302a8c98c8d1c98daa34cb (diff)
[InstCombine] FoldICmpCstShrCst failed for ashr when comparing against -1
(icmp eq (ashr C1, %V) -1) may have multiple answers if C1 is not a power of two and has the sign bit set. This fixes PR24873. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/icmp-shr.ll')
-rw-r--r--test/Transforms/InstCombine/icmp-shr.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp-shr.ll b/test/Transforms/InstCombine/icmp-shr.ll
index 52414b99cca..4fa85a72baf 100644
--- a/test/Transforms/InstCombine/icmp-shr.ll
+++ b/test/Transforms/InstCombine/icmp-shr.ll
@@ -376,3 +376,12 @@ define i1 @PR21222(i32 %B) {
%cmp = icmp eq i32 %shr, -2
ret i1 %cmp
}
+
+; CHECK-LABEL: @PR24873(
+; CHECK: %[[icmp:.*]] = icmp ugt i64 %V, 61
+; CHECK-NEXT: ret i1 %[[icmp]]
+define i1 @PR24873(i64 %V) {
+ %ashr = ashr i64 -4611686018427387904, %V
+ %icmp = icmp eq i64 %ashr, -1
+ ret i1 %icmp
+}