mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
[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:
@@ -239,8 +239,7 @@ void MipsAsmPrinter::EmitFunctionBodyStart() {
|
|||||||
|
|
||||||
OutStreamer.EmitRawText(StringRef("\t.set\tnoreorder"));
|
OutStreamer.EmitRawText(StringRef("\t.set\tnoreorder"));
|
||||||
OutStreamer.EmitRawText(StringRef("\t.set\tnomacro"));
|
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
|
// always be at the function end, and we can't emit and
|
||||||
// break with BB logic.
|
// break with BB logic.
|
||||||
if (OutStreamer.hasRawTextSupport()) {
|
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\tmacro"));
|
||||||
OutStreamer.EmitRawText(StringRef("\t.set\treorder"));
|
OutStreamer.EmitRawText(StringRef("\t.set\treorder"));
|
||||||
OutStreamer.EmitRawText("\t.end\t" + Twine(CurrentFnSym->getName()));
|
OutStreamer.EmitRawText("\t.end\t" + Twine(CurrentFnSym->getName()));
|
||||||
|
|||||||
@@ -424,8 +424,6 @@ bool MipsLongBranch::runOnMachineFunction(MachineFunction &F) {
|
|||||||
|
|
||||||
// Compute basic block addresses.
|
// Compute basic block addresses.
|
||||||
if (TM.getRelocationModel() == Reloc::PIC_) {
|
if (TM.getRelocationModel() == Reloc::PIC_) {
|
||||||
MF->getInfo<MipsFunctionInfo>()->setEmitNOAT();
|
|
||||||
|
|
||||||
uint64_t Address = 0;
|
uint64_t Address = 0;
|
||||||
|
|
||||||
for (I = MBBInfos.begin(); I != E; Address += I->Size, ++I)
|
for (I = MBBInfos.begin(); I != E; Address += I->Size, ++I)
|
||||||
|
|||||||
@@ -51,12 +51,10 @@ class MipsFunctionInfo : public MachineFunctionInfo {
|
|||||||
unsigned NextStackOffset;
|
unsigned NextStackOffset;
|
||||||
bool HasByvalArg;
|
bool HasByvalArg;
|
||||||
|
|
||||||
bool EmitNOAT;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MipsFunctionInfo(MachineFunction& MF)
|
MipsFunctionInfo(MachineFunction& MF)
|
||||||
: MF(MF), SRetReturnReg(0), GlobalBaseReg(0), Mips16SPAliasReg(0),
|
: MF(MF), SRetReturnReg(0), GlobalBaseReg(0), Mips16SPAliasReg(0),
|
||||||
VarArgsFrameIndex(0), EmitNOAT(false)
|
VarArgsFrameIndex(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
unsigned getSRetReturnReg() const { return SRetReturnReg; }
|
unsigned getSRetReturnReg() const { return SRetReturnReg; }
|
||||||
@@ -77,9 +75,6 @@ public:
|
|||||||
NextStackOffset = Offset;
|
NextStackOffset = Offset;
|
||||||
HasByvalArg = HasByval;
|
HasByvalArg = HasByval;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool getEmitNOAT() const { return EmitNOAT; }
|
|
||||||
void setEmitNOAT() { EmitNOAT = true; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end of namespace llvm
|
} // end of namespace llvm
|
||||||
|
|||||||
@@ -260,7 +260,6 @@ void MipsSEInstrInfo::adjustStackPtr(unsigned SP, int64_t Amount,
|
|||||||
if (isInt<16>(Amount))// addi sp, sp, amount
|
if (isInt<16>(Amount))// addi sp, sp, amount
|
||||||
BuildMI(MBB, I, DL, get(ADDiu), SP).addReg(SP).addImm(Amount);
|
BuildMI(MBB, I, DL, get(ADDiu), SP).addReg(SP).addImm(Amount);
|
||||||
else { // Expand immediate that doesn't fit in 16-bit.
|
else { // Expand immediate that doesn't fit in 16-bit.
|
||||||
MBB.getParent()->getInfo<MipsFunctionInfo>()->setEmitNOAT();
|
|
||||||
unsigned Reg = loadImmediate(Amount, MBB, I, DL, 0);
|
unsigned Reg = loadImmediate(Amount, MBB, I, DL, 0);
|
||||||
BuildMI(MBB, I, DL, get(ADDu), SP).addReg(SP).addReg(Reg);
|
BuildMI(MBB, I, DL, get(ADDu), SP).addReg(SP).addReg(Reg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ void MipsSERegisterInfo::eliminateFI(MachineBasicBlock::iterator II,
|
|||||||
MachineInstr &MI = *II;
|
MachineInstr &MI = *II;
|
||||||
MachineFunction &MF = *MI.getParent()->getParent();
|
MachineFunction &MF = *MI.getParent()->getParent();
|
||||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||||
MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
|
|
||||||
|
|
||||||
const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
|
const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
|
||||||
int MinCSFI = 0;
|
int MinCSFI = 0;
|
||||||
@@ -119,7 +118,6 @@ void MipsSERegisterInfo::eliminateFI(MachineBasicBlock::iterator II,
|
|||||||
unsigned ATReg = Subtarget.isABI_N64() ? Mips::AT_64 : Mips::AT;
|
unsigned ATReg = Subtarget.isABI_N64() ? Mips::AT_64 : Mips::AT;
|
||||||
unsigned NewImm;
|
unsigned NewImm;
|
||||||
|
|
||||||
MipsFI->setEmitNOAT();
|
|
||||||
unsigned Reg = TII.loadImmediate(Offset, MBB, II, DL, &NewImm);
|
unsigned Reg = TII.loadImmediate(Offset, MBB, II, DL, &NewImm);
|
||||||
BuildMI(MBB, II, DL, TII.get(ADDu), ATReg).addReg(FrameReg).addReg(Reg);
|
BuildMI(MBB, II, DL, TII.get(ADDu), ATReg).addReg(FrameReg).addReg(Reg);
|
||||||
|
|
||||||
|
|||||||
11
test/CodeGen/Mips/check-noat.ll
Normal file
11
test/CodeGen/Mips/check-noat.ll
Normal 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
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user