LoopVectorize: We don't need an identity element for min/max reductions
authorArnold Schwaighofer <aschwaighofer@apple.com>
Sun, 5 May 2013 01:54:42 +0000 (01:54 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Sun, 5 May 2013 01:54:42 +0000 (01:54 +0000)
commitc1738fdadd1c969f13bbf09fe9c36fff56ccd709
treee97326bd2650fbd99f7751a113e1888449fc852f
parent5c332dbd30d9398ed25b30c3080506f7b8e92290
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
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/minmax_reduction.ll