[llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h

Alkis Evlogimenos alkis at cs.uiuc.edu
Sun Mar 14 01:21:22 PST 2004


Changes in directory llvm/include/llvm/Target:

MRegisterInfo.h updated: 1.39 -> 1.40

---
Log message:

Change MRegisterInfo::foldMemoryOperand to return the folded
instruction to make the API more flexible.


---
Diffs of the changes:  (+10 -9)

Index: llvm/include/llvm/Target/MRegisterInfo.h
diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.39 llvm/include/llvm/Target/MRegisterInfo.h:1.40
--- llvm/include/llvm/Target/MRegisterInfo.h:1.39	Thu Feb 26 16:00:20 2004
+++ llvm/include/llvm/Target/MRegisterInfo.h	Sun Mar 14 01:19:51 2004
@@ -253,15 +253,16 @@
                            const TargetRegisterClass *RC) const = 0;
 
 
-  /// foldMemoryOperand - If this target supports it, fold a load or store of
-  /// the specified stack slot into the specified machine instruction for the
-  /// specified operand.  If this is possible, the target should perform the
-  /// folding and return true, otherwise it should return false.  If it folds
-  /// the instruction, it is likely that the MachineInstruction the iterator
-  /// references has been changed.
-  virtual bool foldMemoryOperand(MachineBasicBlock::iterator &MI,
-                                 unsigned OpNum, int FrameIndex) const {
-    return false;
+  /// foldMemoryOperand - Attempt to fold a load or store of the
+  /// specified stack slot into the specified machine instruction for
+  /// the specified operand.  If this is possible, a new instruction
+  /// is returned with the specified operand folded, otherwise NULL is
+  /// returned. The client is responsible for removing the old
+  /// instruction and adding the new one in the instruction stream
+  virtual MachineInstr* foldMemoryOperand(MachineBasicBlock::iterator MI,
+                                          unsigned OpNum,
+                                          int FrameIndex) const {
+    return NULL;
   }
 
   /// getCallFrameSetup/DestroyOpcode - These methods return the opcode of the





More information about the llvm-commits mailing list