[mips] Delete MipsFunctionInfo::EmitNOAT. Unconditionally print directive

"set .noat" so that the assembler doesn't issue warnings when register $AT is
used.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167310 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Akira Hatanaka 2012-11-02 20:56:25 +00:00
parent 986f29c7ba
commit 173192fa71
6 changed files with 14 additions and 16 deletions

View File

@ -239,8 +239,7 @@ void MipsAsmPrinter::EmitFunctionBodyStart() {
OutStreamer.EmitRawText(StringRef("\t.set\tnoreorder"));
OutStreamer.EmitRawText(StringRef("\t.set\tnomacro"));
if (MipsFI->getEmitNOAT())
OutStreamer.EmitRawText(StringRef("\t.set\tnoat"));
OutStreamer.EmitRawText(StringRef("\t.set\tnoat"));
}
}
@ -251,9 +250,7 @@ void MipsAsmPrinter::EmitFunctionBodyEnd() {
// always be at the function end, and we can't emit and
// break with BB logic.
if (OutStreamer.hasRawTextSupport()) {
if (MipsFI->getEmitNOAT())
OutStreamer.EmitRawText(StringRef("\t.set\tat"));
OutStreamer.EmitRawText(StringRef("\t.set\tat"));
OutStreamer.EmitRawText(StringRef("\t.set\tmacro"));
OutStreamer.EmitRawText(StringRef("\t.set\treorder"));
OutStreamer.EmitRawText("\t.end\t" + Twine(CurrentFnSym->getName()));

View File

@ -424,8 +424,6 @@ bool MipsLongBranch::runOnMachineFunction(MachineFunction &F) {
// Compute basic block addresses.
if (TM.getRelocationModel() == Reloc::PIC_) {
MF->getInfo<MipsFunctionInfo>()->setEmitNOAT();
uint64_t Address = 0;
for (I = MBBInfos.begin(); I != E; Address += I->Size, ++I)

View File

@ -51,12 +51,10 @@ class MipsFunctionInfo : public MachineFunctionInfo {
unsigned NextStackOffset;
bool HasByvalArg;
bool EmitNOAT;
public:
MipsFunctionInfo(MachineFunction& MF)
: MF(MF), SRetReturnReg(0), GlobalBaseReg(0), Mips16SPAliasReg(0),
VarArgsFrameIndex(0), EmitNOAT(false)
VarArgsFrameIndex(0)
{}
unsigned getSRetReturnReg() const { return SRetReturnReg; }
@ -77,9 +75,6 @@ public:
NextStackOffset = Offset;
HasByvalArg = HasByval;
}
bool getEmitNOAT() const { return EmitNOAT; }
void setEmitNOAT() { EmitNOAT = true; }
};
} // end of namespace llvm

View File

@ -260,7 +260,6 @@ void MipsSEInstrInfo::adjustStackPtr(unsigned SP, int64_t Amount,
if (isInt<16>(Amount))// addi sp, sp, amount
BuildMI(MBB, I, DL, get(ADDiu), SP).addReg(SP).addImm(Amount);
else { // Expand immediate that doesn't fit in 16-bit.
MBB.getParent()->getInfo<MipsFunctionInfo>()->setEmitNOAT();
unsigned Reg = loadImmediate(Amount, MBB, I, DL, 0);
BuildMI(MBB, I, DL, get(ADDu), SP).addReg(SP).addReg(Reg);
}

View File

@ -72,7 +72,6 @@ void MipsSERegisterInfo::eliminateFI(MachineBasicBlock::iterator II,
MachineInstr &MI = *II;
MachineFunction &MF = *MI.getParent()->getParent();
MachineFrameInfo *MFI = MF.getFrameInfo();
MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
int MinCSFI = 0;
@ -119,7 +118,6 @@ void MipsSERegisterInfo::eliminateFI(MachineBasicBlock::iterator II,
unsigned ATReg = Subtarget.isABI_N64() ? Mips::AT_64 : Mips::AT;
unsigned NewImm;
MipsFI->setEmitNOAT();
unsigned Reg = TII.loadImmediate(Offset, MBB, II, DL, &NewImm);
BuildMI(MBB, II, DL, TII.get(ADDu), ATReg).addReg(FrameReg).addReg(Reg);

View File

@ -0,0 +1,11 @@
; RUN: llc -march=mipsel < %s | FileCheck %s
define void @f() nounwind readnone {
entry:
; CHECK: f:
; CHECK: .set noat
; CHECK: .set at
ret void
}