Improve ISel across lane float min/max reduction
authorJun Bum Lim <junbuml@codeaurora.org>
Fri, 9 Oct 2015 14:11:25 +0000 (14:11 +0000)
committerJun Bum Lim <junbuml@codeaurora.org>
Fri, 9 Oct 2015 14:11:25 +0000 (14:11 +0000)
commit6bdac546b9727965c9aa15f5da0d4b3ea43c209f
tree7750aaabbddfb49f4abb81fb45295d78dd28cb77
parent0425965d3ddad80c886b6795361c1902f7e1dd78
Improve ISel across lane float min/max reduction

In vectorized float min/max reduction code, the final "reduce" step
is sub-optimal. In AArch64, this change wll combine :

  svn0 = vector_shuffle t0, undef<2,3,u,u>
  fmin = fminnum t0,svn0
  svn1 = vector_shuffle fmin, undef<1,u,u,u>
  cc = setcc fmin, svn1, ole
  n0 = extract_vector_elt cc, #0
  n1 = extract_vector_elt fmin, #0
  n2 = extract_vector_elt fmin, #1
  result = select n0, n1,n2
into :
  result = llvm.aarch64.neon.fminnmv t0

This change extends r247575.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249834 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64ISelLowering.cpp
test/CodeGen/AArch64/aarch64-minmaxv.ll