summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopVectorize
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
commita670a0a3aafba2ce41faffe070880807d69940d8 (patch)
tree91af1839d664d2967c124075e7b97c66455c22e7 /llvm/test/Transforms/LoopVectorize
parent010316ce34b857d415c9f30a79ef7d27f7beb866 (diff)
downloadbcm5719-llvm-a670a0a3aafba2ce41faffe070880807d69940d8.tar.gz
bcm5719-llvm-a670a0a3aafba2ce41faffe070880807d69940d8.zip
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 llvm-svn: 181141
Diffstat (limited to 'llvm/test/Transforms/LoopVectorize')
-rw-r--r--llvm/test/Transforms/LoopVectorize/minmax_reduction.ll5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/test/Transforms/LoopVectorize/minmax_reduction.ll b/llvm/test/Transforms/LoopVectorize/minmax_reduction.ll
index 99dd09386f5..36a8758e2cc 100644
--- a/llvm/test/Transforms/LoopVectorize/minmax_reduction.ll
+++ b/llvm/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
OpenPOWER on IntegriCloud