diff options
| author | Akira Hatanaka <ahatanak@gmail.com> | 2011-09-27 16:58:43 +0000 |
|---|---|---|
| committer | Akira Hatanaka <ahatanak@gmail.com> | 2011-09-27 16:58:43 +0000 |
| commit | ff5d0965b0a89a6ccbe952b64b1e27ab128e6d93 (patch) | |
| tree | 2baef4b222c2c733c8426e4754d53279faa2c2a1 | |
| parent | 86de1a666d3ab4dc92f44064577297019af8f851 (diff) | |
| download | bcm5719-llvm-ff5d0965b0a89a6ccbe952b64b1e27ab128e6d93.tar.gz bcm5719-llvm-ff5d0965b0a89a6ccbe952b64b1e27ab128e6d93.zip | |
Do not add the pass that restores $gp if target is Mips64.
llvm-svn: 140607
| -rw-r--r-- | llvm/lib/Target/Mips/MipsTargetMachine.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp index 25211d472f0..a318f81352a 100644 --- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp +++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp @@ -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; } |

