summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsTargetMachine.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2013-10-07 19:13:53 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2013-10-07 19:13:53 +0000
commitc746503425fc04e25af680d244f9f351675210d5 (patch)
tree380c377a40fb8ee30755c3658cdb1caa499a9cba /lib/Target/Mips/MipsTargetMachine.cpp
parent51a8280fbb54d914192d5d56e0e14571083ef626 (diff)
downloadllvm-c746503425fc04e25af680d244f9f351675210d5.tar.gz
llvm-c746503425fc04e25af680d244f9f351675210d5.tar.bz2
llvm-c746503425fc04e25af680d244f9f351675210d5.tar.xz
[mips] Disable tail merging when long branch pass is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192124 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsTargetMachine.cpp')
-rw-r--r--lib/Target/Mips/MipsTargetMachine.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp
index 06f78e0ab3..5046c1b782 100644
--- a/lib/Target/Mips/MipsTargetMachine.cpp
+++ b/lib/Target/Mips/MipsTargetMachine.cpp
@@ -135,7 +135,13 @@ namespace {
class MipsPassConfig : public TargetPassConfig {
public:
MipsPassConfig(MipsTargetMachine *TM, PassManagerBase &PM)
- : TargetPassConfig(TM, PM) {}
+ : TargetPassConfig(TM, PM) {
+ // The current implementation of long branch pass requires a scratch
+ // register ($at) to be available before branch instructions. Tail merging
+ // can break this requirement, so disable it when long branch pass is
+ // enabled.
+ EnableTailMerge = !getMipsSubtarget().enableLongBranchPass();
+ }
MipsTargetMachine &getMipsTargetMachine() const {
return getTM<MipsTargetMachine>();