summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-09-15 16:23:20 +0000
committerSanjay Patel <spatel@rotateright.com>2016-09-15 16:23:20 +0000
commit40c53ea93374d90c303e4b9606cbcc745db9df95 (patch)
tree7221a277b7029e47c9a4da67a7dea730893642ee /llvm/test/Transforms
parent78a7c7d26a27a95eee3114affbbd027d08261dee (diff)
downloadbcm5719-llvm-40c53ea93374d90c303e4b9606cbcc745db9df95.tar.gz
bcm5719-llvm-40c53ea93374d90c303e4b9606cbcc745db9df95.zip
[InstCombine] allow (icmp sgt smin(PosA, B), 0) fold for vectors
llvm-svn: 281624
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/min-positive.ll14
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/test/Transforms/InstCombine/min-positive.ll b/llvm/test/Transforms/InstCombine/min-positive.ll
index 58258e1a293..c82e51a0e43 100644
--- a/llvm/test/Transforms/InstCombine/min-positive.ll
+++ b/llvm/test/Transforms/InstCombine/min-positive.ll
@@ -19,11 +19,7 @@ define i1 @smin(i32 %other) {
define <2 x i1> @smin_vec(<2 x i32> %x, <2 x i32> %other) {
; CHECK-LABEL: @smin_vec(
-; CHECK-NEXT: [[NOTNEG:%.*]] = and <2 x i32> %x, <i32 7, i32 7>
-; CHECK-NEXT: [[POSITIVE:%.*]] = or <2 x i32> [[NOTNEG]], <i32 1, i32 1>
-; CHECK-NEXT: [[CMP:%.*]] = icmp slt <2 x i32> [[POSITIVE]], %other
-; CHECK-NEXT: [[SEL:%.*]] = select <2 x i1> [[CMP]], <2 x i32> [[POSITIVE]], <2 x i32> %other
-; CHECK-NEXT: [[TEST:%.*]] = icmp sgt <2 x i32> [[SEL]], zeroinitializer
+; CHECK-NEXT: [[TEST:%.*]] = icmp sgt <2 x i32> %other, zeroinitializer
; CHECK-NEXT: ret <2 x i1> [[TEST]]
;
%notneg = and <2 x i32> %x, <i32 7, i32 7>
@@ -48,16 +44,12 @@ define i1 @smin_commute(i32 %other) {
define <2 x i1> @smin_commute_vec(<2 x i32> %x, <2 x i32> %other) {
; CHECK-LABEL: @smin_commute_vec(
-; CHECK-NEXT: [[NOTNEG:%.*]] = and <2 x i32> %x, <i32 7, i32 7>
-; CHECK-NEXT: [[POSITIVE:%.*]] = or <2 x i32> [[NOTNEG]], <i32 1, i32 1>
-; CHECK-NEXT: [[CMP:%.*]] = icmp slt <2 x i32> [[POSITIVE]], %other
-; CHECK-NEXT: [[SEL:%.*]] = select <2 x i1> [[CMP]], <2 x i32> %other, <2 x i32> [[POSITIVE]]
-; CHECK-NEXT: [[TEST:%.*]] = icmp sgt <2 x i32> [[SEL]], zeroinitializer
+; CHECK-NEXT: [[TEST:%.*]] = icmp sgt <2 x i32> %other, zeroinitializer
; CHECK-NEXT: ret <2 x i1> [[TEST]]
;
%notneg = and <2 x i32> %x, <i32 7, i32 7>
%positive = or <2 x i32> %notneg, <i32 1, i32 1>
- %cmp = icmp slt <2 x i32> %positive, %other
+ %cmp = icmp slt <2 x i32> %other, %positive
%sel = select <2 x i1> %cmp, <2 x i32> %other, <2 x i32> %positive
%test = icmp sgt <2 x i32> %sel, zeroinitializer
ret <2 x i1> %test
OpenPOWER on IntegriCloud