summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorArnold Schwaighofer <aschwaighofer@apple.com>2013-05-05 01:54:42 +0000
committerArnold Schwaighofer <aschwaighofer@apple.com>2013-05-05 01:54:42 +0000
commitc1738fdadd1c969f13bbf09fe9c36fff56ccd709 (patch)
treee97326bd2650fbd99f7751a113e1888449fc852f /test/Transforms
parent5c332dbd30d9398ed25b30c3080506f7b8e92290 (diff)
downloadllvm-c1738fdadd1c969f13bbf09fe9c36fff56ccd709.tar.gz
llvm-c1738fdadd1c969f13bbf09fe9c36fff56ccd709.tar.bz2
llvm-c1738fdadd1c969f13bbf09fe9c36fff56ccd709.tar.xz
LoopVectorize: We don't need an identity element for min/max reductions
We can just use the initial element that feeds the reduction. max(max(x, y), z) == max(max(x,y), max(x,z)) radar://13723044 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181141 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/LoopVectorize/minmax_reduction.ll5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/Transforms/LoopVectorize/minmax_reduction.ll b/test/Transforms/LoopVectorize/minmax_reduction.ll
index 99dd09386f..36a8758e2c 100644
--- a/test/Transforms/LoopVectorize/minmax_reduction.ll
+++ b/test/Transforms/LoopVectorize/minmax_reduction.ll
@@ -6,8 +6,11 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
; Signed tests.
-; Turn this into a max reduction.
+; Turn this into a max reduction. Make sure we use a splat to initialize the
+; vector for the reduction.
; CHECK: @max_red
+; CHECK: %[[VAR:.*]] = insertelement <2 x i32> undef, i32 %max, i32 0
+; CHECK: {{.*}} = shufflevector <2 x i32> %[[VAR]], <2 x i32> undef, <2 x i32> zeroinitializer
; CHECK: icmp sgt <2 x i32>
; CHECK: select <2 x i1>
; CHECK: middle.block