diff options
author | Eric Christopher <echristo@apple.com> | 2010-11-11 19:47:02 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2010-11-11 19:47:02 +0000 |
commit | b90f7004cff7329b35e642a7066b800640fde48f (patch) | |
tree | ad724f84e2fc6d27fac53c2501fce6ca982631b2 /llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | |
parent | 34d77dc49aa988af94372d97700fbd86b269d5cb (diff) | |
download | bcm5719-llvm-b90f7004cff7329b35e642a7066b800640fde48f.tar.gz bcm5719-llvm-b90f7004cff7329b35e642a7066b800640fde48f.zip |
Revert this temporarily.
llvm-svn: 118827
Diffstat (limited to 'llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | 61 |
1 files changed, 8 insertions, 53 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp index 36d8a079708..b023379e7ba 100644 --- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -208,10 +208,8 @@ ARMBaseInstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB, DebugLoc DL; if (MI != MBB.end()) DL = MI->getDebugLoc(); - MachineInstrBuilder MIB = BuildMI(MBB, MI, DL, get(ARM::tPUSH)); - AddDefaultPred(MIB); - for (unsigned i = CSI.size(); i != 0; --i) { - unsigned Reg = CSI[i-1].getReg(); + for (unsigned i = 0, e = CSI.size(); i != e; ++i) { + unsigned Reg = CSI[i].getReg(); bool isKill = true; // Add the callee-saved register as live-in unless it's LR and @@ -227,58 +225,15 @@ ARMBaseInstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB, if (isKill) MBB.addLiveIn(Reg); - if (!isARMPushRegister(Reg)) { - const TargetRegisterClass *RC = TRI->getMinimalPhysRegClass(Reg); - storeRegToStackSlot(MBB, MI, Reg, isKill, - CSI[i-1].getFrameIdx(), RC, TRI); - } else - MIB.addReg(Reg, getKillRegState(isKill)); - } - return true; -} - -bool -ARMBaseInstrInfo::restoreCalleeSavedRegisters(MachineBasicBlock &MBB, - MachineBasicBlock::iterator MI, - const std::vector<CalleeSavedInfo> &CSI, - const TargetRegisterInfo *TRI) const { - MachineFunction &MF = *MBB.getParent(); - ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); - if (CSI.empty()) - return false; - - bool isVarArg = AFI->getVarArgsRegSaveSize() > 0; - DebugLoc DL = MI->getDebugLoc(); - MachineInstrBuilder MIB = BuildMI(MF, DL, get(ARM::tPOP)); - AddDefaultPred(MIB); - - bool NumRegs = false; - for (unsigned i = CSI.size(); i != 0; --i) { - unsigned Reg = CSI[i-1].getReg(); - if (Reg == ARM::LR && !isVarArg) { - Reg = ARM::PC; - (*MIB).setDesc(get(ARM::tPOP_RET)); - MI = MBB.erase(MI); - } - - if (!isARMPushRegister(Reg)) { - const TargetRegisterClass *RC = TRI->getMinimalPhysRegClass(Reg); - loadRegFromStackSlot(MBB, MI, Reg, CSI[i-1].getFrameIdx(), RC, TRI); - } else - MIB.addReg(Reg, getDefRegState(true)); - NumRegs = true; + // Insert the spill to the stack frame. The register is killed at the spill + // + const TargetRegisterClass *RC = TRI->getMinimalPhysRegClass(Reg); + storeRegToStackSlot(MBB, MI, Reg, isKill, + CSI[i].getFrameIdx(), RC, TRI); } - - // It's illegal to emit pop instruction without operands. - if (NumRegs) - MBB.insert(MI, &*MIB); - else - MF.DeleteMachineInstr(MIB); - return true; } - // Branch analysis. bool ARMBaseInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB, @@ -2091,7 +2046,7 @@ int ARMBaseInstrInfo::getInstrLatency(const InstrItineraryData *ItinData, case ARM::VLDMQ: case ARM::VSTMQ: return 2; - } + } } bool ARMBaseInstrInfo:: |