diff options
author | Petar Jovanovic <petar.jovanovic@rt-rk.com> | 2013-10-11 03:56:01 +0200 |
---|---|---|
committer | Petar Jovanovic <petar.jovanovic@rt-rk.com> | 2013-10-11 03:56:01 +0200 |
commit | 1763e0545c0ee2748b6dbf4aaa1b4bb9d20a2ef0 (patch) | |
tree | 67c628710a4e54420f549ec6e14b3e7a74d86729 /lib | |
parent | 6a1116e13a072e4f037ad9bd29763086d5124f04 (diff) |
Apply upstream: [mips] Disable tail merging when long branch pass is enabled.
Cherry-pick r192124 from upstream.
Original commit message:
Author: Akira Hatanaka <ahatanaka@mips.com>
Date: Mon Oct 7 19:13:53 2013 +0000
[mips] Disable tail merging when long branch pass is enabled.
Another bug-fix in LongBranchPass, exposed in llc when it is compiled with
LLVM, and visible in NativeClient through llc.nexe.
TBR= mseaborn@chromium.org, dschuff@chromium.org
BUG= bug in llc.nexe for MIPS
Review URL: https://codereview.chromium.org/26963003
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/Mips/MipsTargetMachine.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp index 693558770a..3e264509e8 100644 --- a/lib/Target/Mips/MipsTargetMachine.cpp +++ b/lib/Target/Mips/MipsTargetMachine.cpp @@ -132,7 +132,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>(); |