diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-07-22 20:11:08 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-07-22 20:11:08 +0000 |
| commit | 296a776a5bb58e1ae988175422631a22aba45805 (patch) | |
| tree | 993e6b7785d0477a353fb22cd5dfcf106ba9f6bf /llvm/test | |
| parent | 78d1c32dd6cc5012e6b4951bc85d7380d94164bf (diff) | |
| download | bcm5719-llvm-296a776a5bb58e1ae988175422631a22aba45805.tar.gz bcm5719-llvm-296a776a5bb58e1ae988175422631a22aba45805.zip | |
add tests for icmp vector folds
llvm-svn: 276464
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/icmp.ll | 13 | ||||
| -rw-r--r-- | llvm/test/Transforms/InstCombine/rem.ll | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll index 4575e1017ff..158ef094ade 100644 --- a/llvm/test/Transforms/InstCombine/icmp.ll +++ b/llvm/test/Transforms/InstCombine/icmp.ll @@ -955,6 +955,19 @@ define i1 @test70(i32 %X) { ret i1 %C } +; FIXME: Vectors should fold the same way. + +define <2 x i1> @test70vec(<2 x i32> %X) { +; CHECK-LABEL: @test70vec( +; CHECK-NEXT: [[B:%.*]] = add <2 x i32> %X, <i32 2, i32 2> +; CHECK-NEXT: [[C:%.*]] = icmp ne <2 x i32> [[B]], <i32 4, i32 4> +; CHECK-NEXT: ret <2 x i1> [[C]] +; + %B = add <2 x i32> %X, <i32 2, i32 2> + %C = icmp ne <2 x i32> %B, <i32 4, i32 4> + ret <2 x i1> %C +} + define i1 @icmp_sext16trunc(i32 %x) { ; CHECK-LABEL: @icmp_sext16trunc( ; CHECK-NEXT: [[TMP1:%.*]] = trunc i32 %x to i16 diff --git a/llvm/test/Transforms/InstCombine/rem.ll b/llvm/test/Transforms/InstCombine/rem.ll index ae331eed1a5..cd3c937b267 100644 --- a/llvm/test/Transforms/InstCombine/rem.ll +++ b/llvm/test/Transforms/InstCombine/rem.ll @@ -53,6 +53,19 @@ define i1 @test3a(i32 %A) { ret i1 %C } +; FIXME: Vectors should fold the same way. + +define <2 x i1> @test3a_vec(<2 x i32> %A) { +; CHECK-LABEL: @test3a_vec( +; CHECK-NEXT: [[B:%.*]] = srem <2 x i32> %A, <i32 8, i32 8> +; CHECK-NEXT: [[C:%.*]] = icmp ne <2 x i32> [[B]], zeroinitializer +; CHECK-NEXT: ret <2 x i1> [[C]] +; + %B = srem <2 x i32> %A, <i32 -8, i32 -8> + %C = icmp ne <2 x i32> %B, zeroinitializer + ret <2 x i1> %C +} + define i32 @test4(i32 %X, i1 %C) { ; CHECK-LABEL: @test4( ; CHECK-NEXT: [[SEL:%.*]] = select i1 %C, i32 0, i32 7 |

