[DAGCombiner] generalize binop-of-splats scalarization
authorSanjay Patel <spatel@rotateright.com>
Tue, 23 Apr 2019 13:16:41 +0000 (13:16 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 23 Apr 2019 13:16:41 +0000 (13:16 +0000)
commit06ff5eae5b45689a1dccfda5a1013bdc403eea34
treedf2a3317cb0951a375d74255a9e685e6eed60878
parent7edae4c403871a8e97878b8424f5a8f62905357b
[DAGCombiner] generalize binop-of-splats scalarization

If we only match build vectors, we can miss some patterns
that use shuffles as seen in the affected tests.

Note that the underlying calls within getSplatSourceVector()
have the potential for compile-time explosion because of
exponential recursion looking through binop opcodes, but
currently the list of supported opcodes is very limited.
Both of those problems should be addressed in follow-up
patches.

llvm-svn: 358984
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/scalarize-fp.ll