diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-08-30 23:16:59 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-08-30 23:16:59 +0000 |
commit | ddb53dd080e233b7fe58bd69b46eafa3f093ca8c (patch) | |
tree | 029acf095bebb53543e209eefe381ab3a42b485b /llvm/test/Transforms/InstCombine/and.ll | |
parent | 184996bbb4b82ad947507365e55afc5bcca4836d (diff) | |
download | bcm5719-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/and.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/and.ll | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/and.ll b/llvm/test/Transforms/InstCombine/and.ll index 5b48f330495..cf2390c4bd1 100644 --- a/llvm/test/Transforms/InstCombine/and.ll +++ b/llvm/test/Transforms/InstCombine/and.ll @@ -255,11 +255,24 @@ define i1 @test23(i32 %A) { ; %B = icmp sgt i32 %A, 1 %C = icmp sle i32 %A, 2 - ;; A == 2 %D = and i1 %B, %C ret i1 %D } +; FIXME: Vectors should fold too. +define <2 x i1> @test23vec(<2 x i32> %A) { +; CHECK-LABEL: @test23vec( +; CHECK-NEXT: [[B:%.*]] = icmp sgt <2 x i32> %A, <i32 1, i32 1> +; CHECK-NEXT: [[C:%.*]] = icmp slt <2 x i32> %A, <i32 3, i32 3> +; CHECK-NEXT: [[D:%.*]] = and <2 x i1> [[B]], [[C]] +; CHECK-NEXT: ret <2 x i1> [[D]] +; + %B = icmp sgt <2 x i32> %A, <i32 1, i32 1> + %C = icmp sle <2 x i32> %A, <i32 2, i32 2> + %D = and <2 x i1> %B, %C + ret <2 x i1> %D +} + define i1 @test24(i32 %A) { ; CHECK-LABEL: @test24( ; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt i32 %A, 2 @@ -280,11 +293,24 @@ define i1 @test25(i32 %A) { ; %B = icmp sge i32 %A, 50 %C = icmp slt i32 %A, 100 - ;; (A-50) <u 50 %D = and i1 %B, %C ret i1 %D } +; FIXME: Vectors should fold too. +define <2 x i1> @test25vec(<2 x i32> %A) { +; CHECK-LABEL: @test25vec( +; CHECK-NEXT: [[B:%.*]] = icmp sgt <2 x i32> %A, <i32 49, i32 49> +; CHECK-NEXT: [[C:%.*]] = icmp slt <2 x i32> %A, <i32 100, i32 100> +; CHECK-NEXT: [[D:%.*]] = and <2 x i1> [[B]], [[C]] +; CHECK-NEXT: ret <2 x i1> [[D]] +; + %B = icmp sge <2 x i32> %A, <i32 50, i32 50> + %C = icmp slt <2 x i32> %A, <i32 100, i32 100> + %D = and <2 x i1> %B, %C + ret <2 x i1> %D +} + define i1 @test26(i32 %A) { ; CHECK-LABEL: @test26( ; CHECK-NEXT: [[A_OFF:%.*]] = add i32 %A, -49 |