[mips] Disable tail merging when long branch pass is enabled.

llvm-svn: 192124
This commit is contained in:
Akira Hatanaka 2013-10-07 19:13:53 +00:00
parent 7b5e159450
commit 3c0d6afeec
1 changed files with 7 additions and 1 deletions

View File

@ -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>();