llvm.org GIT mirror llvm / 35b35c5
Add a variant of foldMemoryOperand to fold any load / store, not just load / store from / to stack slots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41597 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 13 years ago
7 changed file(s) with 42 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
241241 bool isReMaterializable(const LiveInterval &li, const VNInfo *ValNo,
242242 MachineInstr *MI);
243243
244 /// tryFoldMemoryOperand - Attempts to fold a spill / restore from slot
245 /// to reg into ith operand of specified MI. If it is successul, MI is
246 /// updated with the newly created MI and returns true.
247 bool tryFoldMemoryOperand(MachineInstr* &MI, VirtRegMap &vrm, unsigned index,
248 unsigned i, int slot, unsigned reg);
244 /// tryFoldMemoryOperand - Attempts to fold either a spill / restore from
245 /// slot / to reg or any rematerialized load into ith operand of specified
246 /// MI. If it is successul, MI is updated with the newly created MI and
247 /// returns true.
248 bool tryFoldMemoryOperand(MachineInstr* &MI, VirtRegMap &vrm,
249 unsigned index, unsigned i, bool isSS,
250 MachineInstr *DefMI, int slot, unsigned reg);
249251
250252 static LiveInterval createInterval(unsigned Reg);
251253
520520 return 0;
521521 }
522522
523 /// foldMemoryOperand - Same as the previous version except it allows folding
524 /// of any load and store from / to any address, not just from a specific
525 /// stack slot.
526 virtual MachineInstr* foldMemoryOperand(MachineInstr* MI,
527 unsigned OpNum,
528 MachineInstr* LoadMI) const {
529 return 0;
530 }
531
523532 /// targetHandlesStackFrameRounding - Returns true if the target is responsible
524533 /// for rounding up the stack frame (probably at emitPrologue time).
525534 virtual bool targetHandlesStackFrameRounding() const {
6565 MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum,
6666 int FrameIndex) const;
6767
68 MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum,
69 MachineInstr* LoadMI) const {
70 return 0;
71 }
72
6873 const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
6974
7075 const TargetRegisterClass* const*
4040 MachineInstr* foldMemoryOperand(MachineInstr *MI, unsigned OpNum,
4141 int FrameIndex) const;
4242
43 MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum,
44 MachineInstr* LoadMI) const {
45 return 0;
46 }
47
4348 void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
4449 unsigned DestReg, unsigned SrcReg,
4550 const TargetRegisterClass *RC) const;
4747 MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum,
4848 int FrameIndex) const;
4949
50 MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum,
51 MachineInstr* LoadMI) const {
52 return 0;
53 }
54
5055 void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
5156 unsigned DestReg, unsigned SrcReg,
5257 const TargetRegisterClass *RC) const;
5656 virtual MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum,
5757 int FrameIndex) const;
5858
59 virtual MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum,
60 MachineInstr* LoadMI) const {
61 return 0;
62 }
63
5964 const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
6065
6166 const TargetRegisterClass* const*
5050 unsigned OpNum,
5151 int FrameIndex) const;
5252
53 virtual MachineInstr* foldMemoryOperand(MachineInstr* MI,
54 unsigned OpNum,
55 MachineInstr* LoadMI) const {
56 return 0;
57 }
58
5359 const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
5460
5561 const TargetRegisterClass* const* getCalleeSavedRegClasses(