Don't match x << 1 to LEAL. It's better to emit x + x.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26429 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2006-02-28 21:13:57 +00:00
parent 45ccae5b7d
commit 8c03fe4aca

View File

@ -453,8 +453,11 @@ bool X86DAGToDAGISel::SelectLEAAddr(SDOperand N, SDOperand &Base,
else
AM.IndexReg = CurDAG->getRegister(0, MVT::i32);
if (AM.Scale > 1)
if (AM.Scale > 2)
Complexity += 2;
// Don't match just leal(,%reg,2). It's cheaper to do addl %reg, %reg
else if (AM.Scale > 1)
Complexity++;
// FIXME: We are artificially lowering the criteria to turn ADD %reg, $GA
// to a LEA. This is determined with some expermentation but is by no means