[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelPattern.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Jan 10 20:40:34 PST 2005
Changes in directory llvm/lib/Target/X86:
X86ISelPattern.cpp updated: 1.27 -> 1.28
---
Log message:
Teach the address selector to make 'reg+reg' addressing modes.
---
Diffs of the changes: (+11 -2)
Index: llvm/lib/Target/X86/X86ISelPattern.cpp
diff -u llvm/lib/Target/X86/X86ISelPattern.cpp:1.27 llvm/lib/Target/X86/X86ISelPattern.cpp:1.28
--- llvm/lib/Target/X86/X86ISelPattern.cpp:1.27 Mon Jan 10 22:31:30 2005
+++ llvm/lib/Target/X86/X86ISelPattern.cpp Mon Jan 10 22:40:19 2005
@@ -443,9 +443,18 @@
}
}
- if (AM.BaseType != X86AddressMode::RegBase ||
- AM.Base.Reg)
+ // Is the base register already occupied?
+ if (AM.BaseType != X86AddressMode::RegBase || AM.Base.Reg) {
+ // If so, check to see if the scale index register is set.
+ if (AM.IndexReg == 0) {
+ AM.IndexReg = SelectExpr(N);
+ AM.Scale = 1;
+ return false;
+ }
+
+ // Otherwise, we cannot select it.
return true;
+ }
// Default, generate it as a register.
AM.BaseType = X86AddressMode::RegBase;
More information about the llvm-commits
mailing list