diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-02-08 18:58:00 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-02-08 18:58:00 +0000 |
| commit | f30656add3810515ccd943fec0e2dfe89820ce5e (patch) | |
| tree | e1e449f6796787280dda3da750eac65999e698eb | |
| parent | 9b611e436fbf9f973bb154da477463ae8e8a2c52 (diff) | |
| download | bcm5719-llvm-f30656add3810515ccd943fec0e2dfe89820ce5e.tar.gz bcm5719-llvm-f30656add3810515ccd943fec0e2dfe89820ce5e.zip | |
[InstCombine] Add vector udiv tests
Tests for X udiv C, where C >= signbit
llvm-svn: 324635
| -rw-r--r-- | llvm/test/Transforms/InstCombine/vector-udiv.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/vector-udiv.ll b/llvm/test/Transforms/InstCombine/vector-udiv.ll index 4da964268a6..58d2fece4d7 100644 --- a/llvm/test/Transforms/InstCombine/vector-udiv.ll +++ b/llvm/test/Transforms/InstCombine/vector-udiv.ll @@ -19,6 +19,33 @@ define <4 x i32> @test_v4i32_const_pow2(<4 x i32> %a0) { ret <4 x i32> %1 } +; X udiv C, where C >= signbit +define <4 x i32> @test_v4i32_negconstsplat(<4 x i32> %a0) { +; CHECK-LABEL: @test_v4i32_negconstsplat( +; CHECK-NEXT: [[TMP1:%.*]] = udiv <4 x i32> [[A0:%.*]], <i32 -3, i32 -3, i32 -3, i32 -3> +; CHECK-NEXT: ret <4 x i32> [[TMP1]] +; + %1 = udiv <4 x i32> %a0, <i32 -3, i32 -3, i32 -3, i32 -3> + ret <4 x i32> %1 +} + +define <4 x i32> @test_v4i32_negconst(<4 x i32> %a0) { +; CHECK-LABEL: @test_v4i32_negconst( +; CHECK-NEXT: [[TMP1:%.*]] = udiv <4 x i32> [[A0:%.*]], <i32 -3, i32 -5, i32 -7, i32 -9> +; CHECK-NEXT: ret <4 x i32> [[TMP1]] +; + %1 = udiv <4 x i32> %a0, <i32 -3, i32 -5, i32 -7, i32 -9> + ret <4 x i32> %1 +} + +define <4 x i32> @test_v4i32_negconst_undef(<4 x i32> %a0) { +; CHECK-LABEL: @test_v4i32_negconst_undef( +; CHECK-NEXT: ret <4 x i32> undef +; + %1 = udiv <4 x i32> %a0, <i32 -3, i32 -5, i32 -7, i32 undef> + ret <4 x i32> %1 +} + ; X udiv (C1 << N), where C1 is "1<<C2" --> X >> (N+C2) define <4 x i32> @test_v4i32_shl_splatconst_pow2(<4 x i32> %a0, <4 x i32> %a1) { ; CHECK-LABEL: @test_v4i32_shl_splatconst_pow2( |

