diff options
| author | Brian Gaeke <gaeke@uiuc.edu> | 2004-10-10 19:57:21 +0000 |
|---|---|---|
| committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-10-10 19:57:21 +0000 |
| commit | 7be91b34b8c71755fe6a08a764baae18e4d634e6 (patch) | |
| tree | 2e46d3a8f8521160532e3888f137653f42144237 /llvm/lib | |
| parent | 9770e416c5005522286d4d2a94303a3bd7d3c1f9 (diff) | |
| download | bcm5719-llvm-7be91b34b8c71755fe6a08a764baae18e4d634e6.tar.gz bcm5719-llvm-7be91b34b8c71755fe6a08a764baae18e4d634e6.zip | |
Implement eliminateCallFramePseudoInstr().
Wrap a long comment line.
llvm-svn: 16883
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/SparcV8/SparcV8RegisterInfo.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Target/SparcV8/SparcV8RegisterInfo.cpp b/llvm/lib/Target/SparcV8/SparcV8RegisterInfo.cpp index 9b3c68b8fe7..f09b1aff960 100644 --- a/llvm/lib/Target/SparcV8/SparcV8RegisterInfo.cpp +++ b/llvm/lib/Target/SparcV8/SparcV8RegisterInfo.cpp @@ -77,10 +77,12 @@ void SparcV8RegisterInfo::copyRegToReg(MachineBasicBlock &MBB, void SparcV8RegisterInfo:: eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const { - std::cerr - << "Sorry, I don't know how to eliminate call frame pseudo instrs yet, in\n" - << __FUNCTION__ << " at " << __FILE__ << ":" << __LINE__ << "\n"; - abort(); + MachineInstr &MI = *I; + int size = MI.getOperand (0).getImmedValue (); + if (MI.getOpcode () == V8::ADJCALLSTACKDOWN) + size = -size; + BuildMI (MBB, I, V8::ADDri, 2, V8::SP).addReg (V8::SP).addSImm (size); + MBB.erase (I); } void @@ -115,8 +117,8 @@ void SparcV8RegisterInfo::emitPrologue(MachineFunction &MF) const { // Get the number of bytes to allocate from the FrameInfo int NumBytes = (int) MFI->getStackSize(); - // Emit the correct save instruction based on the number of bytes in the frame. - // Minimum stack frame size according to V8 ABI is: + // Emit the correct save instruction based on the number of bytes in + // the frame. Minimum stack frame size according to V8 ABI is: // 16 words for register window spill // 1 word for address of returned aggregate-value // + 6 words for passing parameters on the stack |

