summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-02 19:19:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-02 19:19:04 +0000
commit83223f52e72534b3c6cd491cffa72a4642262967 (patch)
tree8b97132a3f3b92affbebddf4c492bf7e23f9df19 /test/Transforms
parentf50e3953084cff910450ada6babf672b65ef082d (diff)
downloadllvm-83223f52e72534b3c6cd491cffa72a4642262967.tar.gz
llvm-83223f52e72534b3c6cd491cffa72a4642262967.tar.bz2
llvm-83223f52e72534b3c6cd491cffa72a4642262967.tar.xz
Added support to optimize comparisons with "lshr exact" of a constant.
Patch by Rahul Jain. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-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 dcfff99136..8e107edd76 100644
--- a/test/Transforms/InstCombine/icmp.ll
+++ b/test/Transforms/InstCombine/icmp.ll
@@ -1390,3 +1390,11 @@ define i1 @exact_ashr_eq_false(i32 %a) {
%cmp = icmp eq i32 %shr, -15
ret i1 %cmp
}
+
+; CHECK-LABEL: @exact_lhsr
+; CHECK-NEXT: icmp eq i32 %a, 3
+define i1 @exact_lhsr(i32 %a) {
+ %shr = lshr exact i32 80, %a
+ %cmp = icmp eq i32 %shr, 10
+ ret i1 %cmp
+}