diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-12-01 02:07:52 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-12-01 02:07:52 +0000 |
| commit | e62f97c094dba44e4c259d20135167fa91912eea (patch) | |
| tree | 5d910203fd66c0b5594d9f29a069ae8125283566 /include | |
| parent | 790e11cdff59ed6312c2f1d3d8f63537c2ae2ec5 (diff) | |
Allow some reloads to be folded in multi-use cases. Specifically testl r, r -> cmpl [mem], 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44479 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
| -rw-r--r-- | include/llvm/CodeGen/LiveIntervalAnalysis.h | 3 | ||||
| -rw-r--r-- | include/llvm/Target/MRegisterInfo.h | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h index 725beb708c..5ada1ad149 100644 --- a/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -275,7 +275,8 @@ namespace llvm { /// returns true. bool tryFoldMemoryOperand(MachineInstr* &MI, VirtRegMap &vrm, MachineInstr *DefMI, unsigned InstrIdx, - unsigned OpIdx, unsigned NumUses, + unsigned OpIdx, + SmallVector<unsigned, 2> &UseOps, bool isSS, int Slot, unsigned Reg); /// anyKillInMBBAfterIdx - Returns true if there is a kill of the specified diff --git a/include/llvm/Target/MRegisterInfo.h b/include/llvm/Target/MRegisterInfo.h index bff74de882..ecbee642f4 100644 --- a/include/llvm/Target/MRegisterInfo.h +++ b/include/llvm/Target/MRegisterInfo.h @@ -543,6 +543,14 @@ public: return 0; } + /// foldMemoryOperand - Same as previous except it tries to fold instruction + /// with multiple uses of the same register. + virtual MachineInstr* foldMemoryOperand(MachineInstr* MI, + SmallVectorImpl<unsigned> &UseOps, + int FrameIndex) const { + return 0; + } + /// foldMemoryOperand - Same as the previous version except it allows folding /// of any load and store from / to any address, not just from a specific /// stack slot. @@ -552,6 +560,14 @@ public: return 0; } + /// foldMemoryOperand - Same as previous except it tries to fold instruction + /// with multiple uses of the same register. + virtual MachineInstr* foldMemoryOperand(MachineInstr* MI, + SmallVectorImpl<unsigned> &UseOps, + MachineInstr* LoadMI) const { + return 0; + } + /// getOpcodeAfterMemoryFold - Returns the opcode of the would be new /// instruction after load / store is folded into an instruction of the /// specified opcode. It returns zero if the specified unfolding is not |
