[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Evan Cheng evan.cheng at apple.com
Tue Feb 28 13:14:09 PST 2006



Changes in directory llvm/lib/Target/X86:

X86ISelDAGToDAG.cpp updated: 1.54 -> 1.55
---
Log message:

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


---
Diffs of the changes:  (+4 -1)

 X86ISelDAGToDAG.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.54 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.55
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.54	Sat Feb 25 04:09:08 2006
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp	Tue Feb 28 15:13:57 2006
@@ -453,8 +453,11 @@
   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






More information about the llvm-commits mailing list