[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp

Evan Cheng evan.cheng at apple.com
Tue Feb 6 01:11:36 PST 2007



Changes in directory llvm/lib/Target/ARM:

ARMISelDAGToDAG.cpp updated: 1.105 -> 1.106
---
Log message:

Select add FI, c correctly.

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

 ARMISelDAGToDAG.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.105 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.106
--- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.105	Mon Feb  5 18:22:06 2007
+++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp	Tue Feb  6 03:11:20 2007
@@ -454,7 +454,8 @@
     return false;
 
   RegisterSDNode *LHSR = dyn_cast<RegisterSDNode>(N.getOperand(0));
-  if (LHSR && LHSR->getReg() == ARM::SP) {
+  if (N.getOperand(0).getOpcode() == ISD::FrameIndex ||
+      (LHSR && LHSR->getReg() == ARM::SP)) {
     // If the RHS is + imm8 * scale, fold into addr mode.
     if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
       int RHSC = (int)RHS->getValue();
@@ -462,6 +463,10 @@
         RHSC >>= 2;
         if (RHSC >= 0 && RHSC < 256) {
           Base = N.getOperand(0);
+          if (Base.getOpcode() == ISD::FrameIndex) {
+            int FI = cast<FrameIndexSDNode>(Base)->getIndex();
+            Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());
+          }
           OffImm = CurDAG->getTargetConstant(RHSC, MVT::i32);
           return true;
         }






More information about the llvm-commits mailing list