summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/icmp.ll
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-08-16 21:53:19 +0000
committerSanjay Patel <spatel@rotateright.com>2016-08-16 21:53:19 +0000
commite47df1ac62daa5ef33488a528b14cffd18b3250e (patch)
tree169ec6bac5d4068759282fad2e773c3b1a75894c /llvm/test/Transforms/InstCombine/icmp.ll
parent41cf73ce16c016a02d875364a56e127b4cdf46e8 (diff)
downloadbcm5719-llvm-e47df1ac62daa5ef33488a528b14cffd18b3250e.tar.gz
bcm5719-llvm-e47df1ac62daa5ef33488a528b14cffd18b3250e.zip
[InstCombine] use m_APInt to allow icmp (sub X, Y), C folds for splat constant vectors
llvm-svn: 278859
Diffstat (limited to 'llvm/test/Transforms/InstCombine/icmp.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/icmp.ll10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll
index b9653fcc7e2..4eadccd8cee 100644
--- a/llvm/test/Transforms/InstCombine/icmp.ll
+++ b/llvm/test/Transforms/InstCombine/icmp.ll
@@ -1750,11 +1750,10 @@ define i1 @icmp_sub_3_X_ult_2(i32 %X) {
ret i1 %cmp
}
-; FIXME: Vectors should fold too.
define <2 x i1> @icmp_sub_3_X_ult_2_vec(<2 x i32> %X) {
; CHECK-LABEL: @icmp_sub_3_X_ult_2_vec(
-; CHECK-NEXT: [[ADD:%.*]] = sub <2 x i32> <i32 3, i32 3>, %X
-; CHECK-NEXT: [[CMP:%.*]] = icmp ult <2 x i32> [[ADD]], <i32 2, i32 2>
+; CHECK-NEXT: [[TMP1:%.*]] = or <2 x i32> %X, <i32 1, i32 1>
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i32> [[TMP1]], <i32 3, i32 3>
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
%add = sub <2 x i32> <i32 3, i32 3>, %X
@@ -1796,11 +1795,10 @@ define i1 @icmp_sub_3_X_uge_2(i32 %X) {
ret i1 %cmp
}
-; FIXME: Vectors should fold too.
define <2 x i1> @icmp_sub_3_X_uge_2_vec(<2 x i32> %X) {
; CHECK-LABEL: @icmp_sub_3_X_uge_2_vec(
-; CHECK-NEXT: [[ADD:%.*]] = sub <2 x i32> <i32 3, i32 3>, %X
-; CHECK-NEXT: [[CMP:%.*]] = icmp ugt <2 x i32> [[ADD]], <i32 1, i32 1>
+; CHECK-NEXT: [[TMP1:%.*]] = or <2 x i32> %X, <i32 1, i32 1>
+; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[TMP1]], <i32 3, i32 3>
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
%add = sub <2 x i32> <i32 3, i32 3>, %X
OpenPOWER on IntegriCloud