mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-21 01:25:20 +00:00
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:
parent
45ccae5b7d
commit
8c03fe4aca
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user