[DAGCombiner][x86] extend decompose of integer multiply into shift/add with negation
authorSanjay Patel <spatel@rotateright.com>
Sun, 23 Sep 2018 18:41:38 +0000 (18:41 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 23 Sep 2018 18:41:38 +0000 (18:41 +0000)
commit002794691504532b3ea1bb7ae93bb158050898c9
treef3f13b0dbe8779737ed641460200b8a87ec22c49
parentea5cd3b4760ebe1b0ad4469aa9ba221e00795c51
[DAGCombiner][x86] extend decompose of integer multiply into shift/add with negation

This is an alternative to https://reviews.llvm.org/D37896. We can't decompose
multiplies generically without a target hook to tell us when it's profitable.

ARM and AArch64 may be able to remove some existing code that overlaps with
this transform.

This extends D52195 and may resolve PR34474:
https://bugs.llvm.org/show_bug.cgi?id=34474
(still an open question about transforming legal vector multiplies, but we
could open another bug report for those)

llvm-svn: 342844
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-mul.ll