aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2011-11-07 23:04:49 +0000
committerPete Cooper <peter_cooper@apple.com>2011-11-07 23:04:49 +0000
commita29fc806fe02cea76f7896b7e344bb919dd7ac25 (patch)
treeb72cce46844c98a3b20f8cf768908c7683eef16f /test
parent1b4f6f2532e9a6a99fcab5fde5b4a2187c9c9c2b (diff)
downloadexternal_llvm-a29fc806fe02cea76f7896b7e344bb919dd7ac25.zip
external_llvm-a29fc806fe02cea76f7896b7e344bb919dd7ac25.tar.gz
external_llvm-a29fc806fe02cea76f7896b7e344bb919dd7ac25.tar.bz2
InstCombine now optimizes vector udiv by power of 2 to shifts
Fixes r8429 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144036 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/vec_udiv_to_shift.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/X86/vec_udiv_to_shift.ll b/test/CodeGen/X86/vec_udiv_to_shift.ll
new file mode 100644
index 0000000..e325f61
--- /dev/null
+++ b/test/CodeGen/X86/vec_udiv_to_shift.ll
@@ -0,0 +1,15 @@
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
+define <8 x i16> @udiv_vec8x16(<8 x i16> %var) {
+entry:
+; CHECK: lshr <8 x i16> %var, <i16 5, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5>
+%0 = udiv <8 x i16> %var, <i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32>
+ret <8 x i16> %0
+}
+
+define <4 x i32> @udiv_vec4x32(<4 x i32> %var) {
+entry:
+; CHECK: lshr <4 x i32> %var, <i32 4, i32 4, i32 4, i32 4>
+%0 = udiv <4 x i32> %var, <i32 16, i32 16, i32 16, i32 16>
+ret <4 x i32> %0
+} \ No newline at end of file