[x86] allow single source horizontal op matching (PR39195)
authorSanjay Patel <spatel@rotateright.com>
Wed, 10 Oct 2018 13:39:59 +0000 (13:39 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 10 Oct 2018 13:39:59 +0000 (13:39 +0000)
commit6cca8af2270be8bc5494b44bb8856af591d0385b
treef875071a18f0d27152814e086f606837ff94485f
parentfc51490baf1d6ad5796d8cb8bb0792de13ce8fce
[x86] allow single source horizontal op matching (PR39195)

This is intended to restore horizontal codegen to what it looked like before IR demanded elements improved in:
rL343727

As noted in PR39195:
https://bugs.llvm.org/show_bug.cgi?id=39195
...horizontal ops can be worse for performance than a shuffle+regular binop, so I've added a TODO. Ideally, we'd
solve that in a machine instruction pass, but a quicker solution will be adding a 'HasFastHorizontalOp' feature
bit to deal with it here in the DAG.

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

llvm-svn: 344141
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/avx512-intrinsics-fast-isel.ll
llvm/test/CodeGen/X86/haddsub-undef.ll
llvm/test/CodeGen/X86/phaddsub.ll
llvm/test/CodeGen/X86/vector-shuffle-combining.ll