Do not add the pass that restores $gp if target is Mips64.

llvm-svn: 140607
This commit is contained in:
Akira Hatanaka 2011-09-27 16:58:43 +00:00
parent 86de1a666d
commit ff5d0965b0
1 changed files with 4 additions and 1 deletions

View File

@ -96,7 +96,10 @@ addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel)
bool MipsTargetMachine::
addPreRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel) {
PM.add(createMipsEmitGPRestorePass(*this));
// Do not restore $gp if target is Mips64.
// In N32/64, $gp is a callee-saved register.
if (!Subtarget.hasMips64())
PM.add(createMipsEmitGPRestorePass(*this));
return true;
}