summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-05-30 15:54:32 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-05-30 15:54:32 +0000
commitfcb9926813ef9bd18bf2b3aab4ab58c6522c2c5e (patch)
tree6ad8e9a57ca6f0b0eefabe1b5e2a80d39a63e4c5 /test
parent6319c0c5203450e9d9a79cc6d57764b97d814da2 (diff)
downloadllvm-fcb9926813ef9bd18bf2b3aab4ab58c6522c2c5e.tar.gz
llvm-fcb9926813ef9bd18bf2b3aab4ab58c6522c2c5e.tar.bz2
llvm-fcb9926813ef9bd18bf2b3aab4ab58c6522c2c5e.tar.xz
PR19753: Optimize comparisons with "ashr exact" of a constanst.
Patch by suyog sarda. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/icmp.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll
index f45897cd3e..fd7514d9e1 100644
--- a/test/Transforms/InstCombine/icmp.ll
+++ b/test/Transforms/InstCombine/icmp.ll
@@ -1365,3 +1365,11 @@ define i1 @icmp_neg_cst_slt(i32 %a) {
%2 = icmp slt i32 %1, -10
ret i1 %2
}
+
+; CHECK-LABEL: @exact_ashr_eq_false
+; CHECK-NEXT: icmp eq i32 %a, 1
+define i1 @exact_ashr_eq_false(i32 %a) {
+ %shr = ashr exact i32 -30, %a
+ %cmp = icmp eq i32 %shr, -15
+ ret i1 %cmp
+}