summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/and2.ll
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-08-30 23:16:59 +0000
committerSanjay Patel <spatel@rotateright.com>2016-08-30 23:16:59 +0000
commitddb53dd080e233b7fe58bd69b46eafa3f093ca8c (patch)
tree029acf095bebb53543e209eefe381ab3a42b485b /llvm/test/Transforms/InstCombine/and2.ll
parent184996bbb4b82ad947507365e55afc5bcca4836d (diff)
downloadbcm5719-llvm-ddb53dd080e233b7fe58bd69b46eafa3f093ca8c.tar.gz
bcm5719-llvm-ddb53dd080e233b7fe58bd69b46eafa3f093ca8c.zip
[InstCombine] add tests to show type limitations of InsertRangeTest and callers
llvm-svn: 280175
Diffstat (limited to 'llvm/test/Transforms/InstCombine/and2.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/and2.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/and2.ll b/llvm/test/Transforms/InstCombine/and2.ll
index 49ce3842137..3d043b0864c 100644
--- a/llvm/test/Transforms/InstCombine/and2.ll
+++ b/llvm/test/Transforms/InstCombine/and2.ll
@@ -85,6 +85,20 @@ define i1 @test8(i32 %i) {
ret i1 %cond
}
+; FIXME: Vectors should fold too.
+define <2 x i1> @test8vec(<2 x i32> %i) {
+; CHECK-LABEL: @test8vec(
+; CHECK-NEXT: [[CMP1:%.*]] = icmp ne <2 x i32> %i, zeroinitializer
+; CHECK-NEXT: [[CMP2:%.*]] = icmp ult <2 x i32> %i, <i32 14, i32 14>
+; CHECK-NEXT: [[COND:%.*]] = and <2 x i1> [[CMP1]], [[CMP2]]
+; CHECK-NEXT: ret <2 x i1> [[COND]]
+;
+ %cmp1 = icmp ne <2 x i32> %i, zeroinitializer
+ %cmp2 = icmp ult <2 x i32> %i, <i32 14, i32 14>
+ %cond = and <2 x i1> %cmp1, %cmp2
+ ret <2 x i1> %cond
+}
+
; combine -x & 1 into x & 1
define i64 @test9(i64 %x) {
; CHECK-LABEL: @test9(
OpenPOWER on IntegriCloud