[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp PPC32RegisterInfo.h

Chris Lattner lattner at cs.uiuc.edu
Fri Sep 16 18:03:37 PDT 2005



Changes in directory llvm/lib/Target/PowerPC:

PPC32RegisterInfo.cpp updated: 1.23 -> 1.24
PPC32RegisterInfo.h updated: 1.4 -> 1.5
---
Log message:

Implement hook for ppc


---
Diffs of the changes:  (+18 -0)

 PPC32RegisterInfo.cpp |   16 ++++++++++++++++
 PPC32RegisterInfo.h   |    2 ++
 2 files changed, 18 insertions(+)


Index: llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp:1.23 llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp:1.24
--- llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp:1.23	Fri Sep  9 16:59:44 2005
+++ llvm/lib/Target/PowerPC/PPC32RegisterInfo.cpp	Fri Sep 16 20:03:26 2005
@@ -134,6 +134,22 @@
   }
 }
 
+unsigned PPC32RegisterInfo::isLoadFromStackSlot(MachineInstr *MI, 
+                                                int &FrameIndex) const {
+  switch (MI->getOpcode()) {
+  default: break;
+  case PPC::LWZ:
+  case PPC::LFD:
+    if (MI->getOperand(1).isImmediate() && !MI->getOperand(1).getImmedValue() &&
+        MI->getOperand(2).isFrameIndex()) {
+      FrameIndex = MI->getOperand(2).getFrameIndex();
+      return MI->getOperand(0).getReg();
+    }
+    break;
+  }
+  return 0;
+}
+
 /// foldMemoryOperand - PowerPC (like most RISC's) can only fold spills into
 /// copy instructions, turning them into load/store instructions.
 MachineInstr *PPC32RegisterInfo::foldMemoryOperand(MachineInstr *MI,


Index: llvm/lib/Target/PowerPC/PPC32RegisterInfo.h
diff -u llvm/lib/Target/PowerPC/PPC32RegisterInfo.h:1.4 llvm/lib/Target/PowerPC/PPC32RegisterInfo.h:1.5
--- llvm/lib/Target/PowerPC/PPC32RegisterInfo.h:1.4	Fri Sep  9 16:46:49 2005
+++ llvm/lib/Target/PowerPC/PPC32RegisterInfo.h	Fri Sep 16 20:03:26 2005
@@ -40,6 +40,8 @@
                     unsigned DestReg, unsigned SrcReg,
                     const TargetRegisterClass *RC) const;
 
+  unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
+    
   /// foldMemoryOperand - PowerPC (like most RISC's) can only fold spills into
   /// copy instructions, turning them into load/store instructions.
   virtual MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum,






More information about the llvm-commits mailing list