OSDN Git Service

[X86] Use a shift plus an lea for multiplying by a constant that is a power of 2...
authorCraig Topper <craig.topper@intel.com>
Wed, 25 Jul 2018 01:15:38 +0000 (01:15 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 25 Jul 2018 01:15:38 +0000 (01:15 +0000)
commit0bca0d9f0651efb85988da69d34431d0447af5f1
treea884bdd9f9c9dbf708a2491f216c31e862edbe06
parentd277be2a297ef2d55982e4a63cfd2a8de6d88243
[X86] Use a shift plus an lea for multiplying by a constant that is a power of 2 plus 2/4/8.

The LEA allows us to combine an add and the multiply by 2/4/8 together so we just need a shift for the larger power of 2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337875 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/mul-constant-i16.ll
test/CodeGen/X86/mul-constant-i32.ll
test/CodeGen/X86/mul-constant-i64.ll