summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Target/Mips/Mips.h1
-rw-r--r--llvm/lib/Target/Mips/MipsLongBranch.cpp8
-rw-r--r--llvm/lib/Target/Mips/MipsTargetMachine.cpp1
3 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Target/Mips/Mips.h b/llvm/lib/Target/Mips/Mips.h
index 1ca9ea12ad3..641eecef9c4 100644
--- a/llvm/lib/Target/Mips/Mips.h
+++ b/llvm/lib/Target/Mips/Mips.h
@@ -43,6 +43,7 @@ namespace llvm {
MipsRegisterBankInfo &);
void initializeMipsDelaySlotFillerPass(PassRegistry &);
+ void initializeMipsLongBranchPass(PassRegistry &);
} // end namespace llvm;
#endif
diff --git a/llvm/lib/Target/Mips/MipsLongBranch.cpp b/llvm/lib/Target/Mips/MipsLongBranch.cpp
index 7a7c8abfc6f..d31c6392b2a 100644
--- a/llvm/lib/Target/Mips/MipsLongBranch.cpp
+++ b/llvm/lib/Target/Mips/MipsLongBranch.cpp
@@ -77,8 +77,9 @@ namespace {
public:
static char ID;
- MipsLongBranch()
- : MachineFunctionPass(ID), ABI(MipsABIInfo::Unknown()) {}
+ MipsLongBranch() : MachineFunctionPass(ID), ABI(MipsABIInfo::Unknown()) {
+ initializeMipsLongBranchPass(*PassRegistry::getPassRegistry());
+ }
StringRef getPassName() const override { return "Mips Long Branch"; }
@@ -108,6 +109,9 @@ namespace {
char MipsLongBranch::ID = 0;
+INITIALIZE_PASS(MipsLongBranch, DEBUG_TYPE,
+ "Expand out of range branch instructions", false, false)
+
/// Iterate over list of Br's operands and search for a MachineBasicBlock
/// operand.
static MachineBasicBlock *getTargetMBB(const MachineInstr &Br) {
diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp
index 77f43a26bde..2b9ac2cd900 100644
--- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp
+++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp
@@ -54,6 +54,7 @@ extern "C" void LLVMInitializeMipsTarget() {
PassRegistry *PR = PassRegistry::getPassRegistry();
initializeGlobalISel(*PR);
initializeMipsDelaySlotFillerPass(*PR);
+ initializeMipsLongBranchPass(*PR);
}
static std::string computeDataLayout(const Triple &TT, StringRef CPU,
OpenPOWER on IntegriCloud