OSDN Git Service

[X86][SSE] lowerAddSubToHorizontalOp - enable ymm extraction+fold
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 2 May 2019 14:00:55 +0000 (14:00 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 2 May 2019 14:00:55 +0000 (14:00 +0000)
commit3314e6578bfc33b3d414d2eb38e1ed3702c01d6c
tree072af5bae50516a46a48fb7d135e8b2f08472618
parentb79c73bd103edafbaff703c7230fcf1fe4e3b920
[X86][SSE] lowerAddSubToHorizontalOp - enable ymm extraction+fold

Limiting scalar hadd/hsub generation to the lowest xmm looks to be unnecessary - we will be extracting one upper xmm whatever, and we can remove a shuffle by using the hop which is inline with what shouldUseHorizontalOp expects to happen anyway.

Testing on btver2 (the main target for fast-hops) shows this is beneficial even for float ops where we have a 'shuffle' to extract the float result:
https://godbolt.org/z/0R-U-K

Differential Revision: https://reviews.llvm.org/D61426

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359786 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/haddsub.ll
test/CodeGen/X86/phaddsub-extract.ll