[X86] Form MUL_IMM for multiplies with 3/5/9 to encourage LEA formation over load...
authorCraig Topper <craig.topper@intel.com>
Wed, 25 Apr 2018 17:35:03 +0000 (17:35 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 25 Apr 2018 17:35:03 +0000 (17:35 +0000)
commit300e20d61c331e4978015a9da4288026901c945a
tree5024199f211649ab84ad859ba419e527de6441a6
parent3517ece21f9dbde594e5ada95cd4cf26709d8f3e
[X86] Form MUL_IMM for multiplies with 3/5/9 to encourage LEA formation over load folding.

Previously we only formed MUL_IMM when we split a constant. This blocked load folding on those cases. We should also form MUL_IMM for 3/5/9 to favor LEA over load folding.

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

llvm-svn: 330850
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/imul.ll
llvm/test/CodeGen/X86/mul-constant-i16.ll
llvm/test/CodeGen/X86/mul-constant-i32.ll
llvm/test/CodeGen/X86/mul-constant-i64.ll