diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-04-07 04:29:14 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-04-07 04:29:14 +0000 |
commit | 88ddd4a07de81a14a6c768fe5ac4c6a7481f838d (patch) | |
tree | e5ef8fcc79c7be2cd1329cb0c6484bc854010eaf | |
parent | fa4bb09cf042dc0f30297082f55bc37f35c0f5f5 (diff) | |
download | external_llvm-88ddd4a07de81a14a6c768fe5ac4c6a7481f838d.zip external_llvm-88ddd4a07de81a14a6c768fe5ac4c6a7481f838d.tar.gz external_llvm-88ddd4a07de81a14a6c768fe5ac4c6a7481f838d.tar.bz2 |
Make generation of stack-slot loads and copies less ugly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12742 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/Sparc/SparcRegisterInfo.cpp | 11 | ||||
-rw-r--r-- | lib/Target/SparcV8/SparcV8RegisterInfo.cpp | 11 |
2 files changed, 8 insertions, 14 deletions
diff --git a/lib/Target/Sparc/SparcRegisterInfo.cpp b/lib/Target/Sparc/SparcRegisterInfo.cpp index 5ca69e0..c377612 100644 --- a/lib/Target/Sparc/SparcRegisterInfo.cpp +++ b/lib/Target/Sparc/SparcRegisterInfo.cpp @@ -40,26 +40,23 @@ int SparcV8RegisterInfo::storeRegToStackSlot( int SparcV8RegisterInfo::loadRegFromStackSlot( MachineBasicBlock &MBB, - MachineBasicBlock::iterator MBBI, + MachineBasicBlock::iterator I, unsigned DestReg, int FrameIdx, const TargetRegisterClass *RC) const { assert (RC == SparcV8::IntRegsRegisterClass && "Can only load 32-bit registers from stack slots"); - MachineInstr *I = - BuildMI (V8::LDmr, 2).addReg (DestReg).addFrameIndex (FrameIdx).addSImm (0); - MBB.insert(MBBI, I); + BuildMI (MBB, I, V8::LDmr, 2, DestReg).addFrameIndex (FrameIdx).addSImm (0); return 1; } int SparcV8RegisterInfo::copyRegToReg(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MBBI, + MachineBasicBlock::iterator I, unsigned DestReg, unsigned SrcReg, const TargetRegisterClass *RC) const { assert (RC == SparcV8::IntRegsRegisterClass && "Can only copy 32-bit registers"); - MBB.insert (MBBI, - BuildMI (V8::ORrr, 3, DestReg).addReg (V8::G0).addReg (SrcReg)); + BuildMI (MBB, I, V8::ORrr, 2, DestReg).addReg (V8::G0).addReg (SrcReg); return -1; } diff --git a/lib/Target/SparcV8/SparcV8RegisterInfo.cpp b/lib/Target/SparcV8/SparcV8RegisterInfo.cpp index 5ca69e0..c377612 100644 --- a/lib/Target/SparcV8/SparcV8RegisterInfo.cpp +++ b/lib/Target/SparcV8/SparcV8RegisterInfo.cpp @@ -40,26 +40,23 @@ int SparcV8RegisterInfo::storeRegToStackSlot( int SparcV8RegisterInfo::loadRegFromStackSlot( MachineBasicBlock &MBB, - MachineBasicBlock::iterator MBBI, + MachineBasicBlock::iterator I, unsigned DestReg, int FrameIdx, const TargetRegisterClass *RC) const { assert (RC == SparcV8::IntRegsRegisterClass && "Can only load 32-bit registers from stack slots"); - MachineInstr *I = - BuildMI (V8::LDmr, 2).addReg (DestReg).addFrameIndex (FrameIdx).addSImm (0); - MBB.insert(MBBI, I); + BuildMI (MBB, I, V8::LDmr, 2, DestReg).addFrameIndex (FrameIdx).addSImm (0); return 1; } int SparcV8RegisterInfo::copyRegToReg(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MBBI, + MachineBasicBlock::iterator I, unsigned DestReg, unsigned SrcReg, const TargetRegisterClass *RC) const { assert (RC == SparcV8::IntRegsRegisterClass && "Can only copy 32-bit registers"); - MBB.insert (MBBI, - BuildMI (V8::ORrr, 3, DestReg).addReg (V8::G0).addReg (SrcReg)); + BuildMI (MBB, I, V8::ORrr, 2, DestReg).addReg (V8::G0).addReg (SrcReg); return -1; } |