diff options
author | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-04-06 10:54:50 +0000 |
---|---|---|
committer | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-04-06 10:54:50 +0000 |
commit | cae1b628a791f77fb6a1fd326fbf2230ddc27825 (patch) | |
tree | 546ded361634c2022ec5a6c16288d981c6a0d02a /lib/Target/PIC16/PIC16InstrInfo.cpp | |
parent | 19a8dca186f67899b67fd2b3604e459345f9ff69 (diff) | |
download | llvm-cae1b628a791f77fb6a1fd326fbf2230ddc27825.tar.gz llvm-cae1b628a791f77fb6a1fd326fbf2230ddc27825.tar.bz2 llvm-cae1b628a791f77fb6a1fd326fbf2230ddc27825.tar.xz |
Map stack based frameindices for spills to zero based indices that can be accessed based on an external symbol defining the location of temporary data for a function. For example: we have spill slots addressed as foo.tmp + 0, foo.tmp + 1 etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68442 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PIC16/PIC16InstrInfo.cpp')
-rw-r--r-- | lib/Target/PIC16/PIC16InstrInfo.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/PIC16/PIC16InstrInfo.cpp b/lib/Target/PIC16/PIC16InstrInfo.cpp index 0066e67209..99c27fdac7 100644 --- a/lib/Target/PIC16/PIC16InstrInfo.cpp +++ b/lib/Target/PIC16/PIC16InstrInfo.cpp @@ -69,6 +69,7 @@ void PIC16InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, unsigned SrcReg, bool isKill, int FI, const TargetRegisterClass *RC) const { + PIC16TargetLowering *PTLI = TM.getTargetLowering(); DebugLoc DL = DebugLoc::getUnknownLoc(); if (I != MBB.end()) DL = I->getDebugLoc(); @@ -84,7 +85,7 @@ void PIC16InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB, //MachineRegisterInfo &RI = MF.getRegInfo(); BuildMI(MBB, I, DL, get(PIC16::movwf)) .addReg(SrcReg, false, false, isKill) - .addImm(FI) + .addImm(PTLI->GetTmpOffsetForFI(FI)) .addExternalSymbol(tmpName) .addImm(1); // Emit banksel for it. } @@ -98,6 +99,7 @@ void PIC16InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, unsigned DestReg, int FI, const TargetRegisterClass *RC) const { + PIC16TargetLowering *PTLI = TM.getTargetLowering(); DebugLoc DL = DebugLoc::getUnknownLoc(); if (I != MBB.end()) DL = I->getDebugLoc(); @@ -112,7 +114,7 @@ void PIC16InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB, //MachineFunction &MF = *MBB.getParent(); //MachineRegisterInfo &RI = MF.getRegInfo(); BuildMI(MBB, I, DL, get(PIC16::movf), DestReg) - .addImm(FI) + .addImm(PTLI->GetTmpOffsetForFI(FI)) .addExternalSymbol(tmpName) .addImm(1); // Emit banksel for it. } |