summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-02-17 16:00:42 +0000
committerSanjay Patel <spatel@rotateright.com>2018-02-17 16:00:42 +0000
commitf569578373bc89dc8e6716e4510433c88c5c0554 (patch)
treea54a3017da97bfe492c9de4f323fc054e08b41a4 /llvm/test/Transforms
parenta6a1426cf1acf861609c36c4f37257eb952976d4 (diff)
downloadbcm5719-llvm-f569578373bc89dc8e6716e4510433c88c5c0554.tar.gz
bcm5719-llvm-f569578373bc89dc8e6716e4510433c88c5c0554.zip
[PatternMatch] enhance m_One() to ignore undef elements in vectors
llvm-svn: 325437
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/select.ll2
-rw-r--r--llvm/test/Transforms/InstCombine/vector-urem.ll5
-rw-r--r--llvm/test/Transforms/InstSimplify/icmp-bool-constant.ll9
3 files changed, 7 insertions, 9 deletions
diff --git a/llvm/test/Transforms/InstCombine/select.ll b/llvm/test/Transforms/InstCombine/select.ll
index 50eb281bdd7..5708f5aea3a 100644
--- a/llvm/test/Transforms/InstCombine/select.ll
+++ b/llvm/test/Transforms/InstCombine/select.ll
@@ -74,7 +74,7 @@ define <2 x i1> @trueval_is_true_vec(<2 x i1> %C, <2 x i1> %X) {
define <2 x i1> @trueval_is_true_vec_undef_elt(<2 x i1> %C, <2 x i1> %X) {
; CHECK-LABEL: @trueval_is_true_vec_undef_elt(
-; CHECK-NEXT: [[R:%.*]] = select <2 x i1> [[C:%.*]], <2 x i1> <i1 undef, i1 true>, <2 x i1> [[X:%.*]]
+; CHECK-NEXT: [[R:%.*]] = or <2 x i1> [[C:%.*]], [[X:%.*]]
; CHECK-NEXT: ret <2 x i1> [[R]]
;
%R = select <2 x i1> %C, <2 x i1> <i1 undef, i1 true>, <2 x i1> %X
diff --git a/llvm/test/Transforms/InstCombine/vector-urem.ll b/llvm/test/Transforms/InstCombine/vector-urem.ll
index 7dad59fde24..113451f8469 100644
--- a/llvm/test/Transforms/InstCombine/vector-urem.ll
+++ b/llvm/test/Transforms/InstCombine/vector-urem.ll
@@ -39,8 +39,9 @@ define <4 x i32> @test_v4i32_one(<4 x i32> %a0) {
define <4 x i32> @test_v4i32_one_undef(<4 x i32> %a0) {
; CHECK-LABEL: @test_v4i32_one_undef(
-; CHECK-NEXT: [[TMP1:%.*]] = urem <4 x i32> <i32 1, i32 1, i32 1, i32 undef>, [[A0:%.*]]
-; CHECK-NEXT: ret <4 x i32> [[TMP1]]
+; CHECK-NEXT: [[TMP1:%.*]] = icmp ne <4 x i32> [[A0:%.*]], <i32 1, i32 1, i32 1, i32 undef>
+; CHECK-NEXT: [[TMP2:%.*]] = zext <4 x i1> [[TMP1]] to <4 x i32>
+; CHECK-NEXT: ret <4 x i32> [[TMP2]]
;
%1 = urem <4 x i32> <i32 1, i32 1, i32 1, i32 undef>, %a0
ret <4 x i32> %1
diff --git a/llvm/test/Transforms/InstSimplify/icmp-bool-constant.ll b/llvm/test/Transforms/InstSimplify/icmp-bool-constant.ll
index cf5f6d3f96b..0b7a8297c68 100644
--- a/llvm/test/Transforms/InstSimplify/icmp-bool-constant.ll
+++ b/llvm/test/Transforms/InstSimplify/icmp-bool-constant.ll
@@ -14,8 +14,7 @@ define <2 x i1> @eq_t(<2 x i1> %a) {
define <2 x i1> @eq_t_undef_elt(<2 x i1> %a) {
; CHECK-LABEL: @eq_t_undef_elt(
-; CHECK-NEXT: [[R:%.*]] = icmp eq <2 x i1> [[A:%.*]], <i1 undef, i1 true>
-; CHECK-NEXT: ret <2 x i1> [[R]]
+; CHECK-NEXT: ret <2 x i1> [[A:%.*]]
;
%r = icmp eq <2 x i1> %a, <i1 undef, i1 true>
ret <2 x i1> %r
@@ -57,8 +56,7 @@ define <2 x i1> @ugt_t(<2 x i1> %a) {
define <2 x i1> @ugt_t_undef_elt(<2 x i1> %a) {
; CHECK-LABEL: @ugt_t_undef_elt(
-; CHECK-NEXT: [[R:%.*]] = icmp ugt <2 x i1> [[A:%.*]], <i1 true, i1 undef>
-; CHECK-NEXT: ret <2 x i1> [[R]]
+; CHECK-NEXT: ret <2 x i1> zeroinitializer
;
%r = icmp ugt <2 x i1> %a, <i1 true, i1 undef>
ret <2 x i1> %r
@@ -165,8 +163,7 @@ define <2 x i1> @sge_t(<2 x i1> %a) {
define <2 x i1> @sge_t_undef_elt(<2 x i1> %a) {
; CHECK-LABEL: @sge_t_undef_elt(
-; CHECK-NEXT: [[R:%.*]] = icmp sge <2 x i1> [[A:%.*]], <i1 true, i1 undef>
-; CHECK-NEXT: ret <2 x i1> [[R]]
+; CHECK-NEXT: ret <2 x i1> <i1 true, i1 true>
;
%r = icmp sge <2 x i1> %a, <i1 true, i1 undef>
ret <2 x i1> %r
OpenPOWER on IntegriCloud