Make the following changes in MipsAsmPrinter.cpp:

- Remove code which lowers pseudo SETGP01.
- Fix LowerSETGP01. The first two of the three instructions that are emitted to
  initialize the global pointer register now use register $2.
- Stop emitting .cpload directive.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156689 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Akira Hatanaka
2012-05-12 00:48:43 +00:00
parent 774394c68a
commit 4147e4d054
6 changed files with 19 additions and 37 deletions

View File

@@ -134,15 +134,6 @@ void MipsAsmPrinter::EmitInstruction(const MachineInstr *MI) {
break;
}
case Mips::SETGP01: {
MCInstLowering.LowerSETGP01(MI, MCInsts);
for (SmallVector<MCInst, 4>::iterator I = MCInsts.begin();
I != MCInsts.end(); ++I)
OutStreamer.EmitInstruction(*I);
return;
}
default:
break;
}
@@ -295,10 +286,6 @@ void MipsAsmPrinter::EmitFunctionBodyStart() {
emitFrameDirective();
bool EmitCPLoad = (MF->getTarget().getRelocationModel() == Reloc::PIC_) &&
Subtarget->isABI_O32() && MipsFI->globalBaseRegSet() &&
MipsFI->globalBaseRegFixed();
if (OutStreamer.hasRawTextSupport()) {
SmallString<128> Str;
raw_svector_ostream OS(Str);
@@ -306,17 +293,15 @@ void MipsAsmPrinter::EmitFunctionBodyStart() {
OutStreamer.EmitRawText(OS.str());
OutStreamer.EmitRawText(StringRef("\t.set\tnoreorder"));
// Emit .cpload directive if needed.
if (EmitCPLoad)
OutStreamer.EmitRawText(StringRef("\t.cpload\t$25"));
OutStreamer.EmitRawText(StringRef("\t.set\tnomacro"));
if (MipsFI->getEmitNOAT())
OutStreamer.EmitRawText(StringRef("\t.set\tnoat"));
} else if (EmitCPLoad) {
}
if ((MF->getTarget().getRelocationModel() == Reloc::PIC_) &&
Subtarget->isABI_O32() && MipsFI->globalBaseRegSet()) {
SmallVector<MCInst, 4> MCInsts;
MCInstLowering.LowerCPLOAD(MCInsts);
MCInstLowering.LowerSETGP01(MCInsts);
for (SmallVector<MCInst, 4>::iterator I = MCInsts.begin();
I != MCInsts.end(); ++I)
OutStreamer.EmitInstruction(*I);