summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-11-13 23:52:18 +0000
committerReed Kotler <rkotler@mips.com>2013-11-13 23:52:18 +0000
commit4b7afe5523e7a012364ee36666b9c486e0fb6565 (patch)
treea6a2e06106dcd7373f5994b56ff12a5efcba8805 /llvm/lib/Target/Mips
parentee02a8a926a0add0d6bebdb6c0793b44f2984e98 (diff)
downloadbcm5719-llvm-4b7afe5523e7a012364ee36666b9c486e0fb6565.tar.gz
bcm5719-llvm-4b7afe5523e7a012364ee36666b9c486e0fb6565.zip
Take care of long short branch immediate instructions for mips16 in
constant islands. llvm-svn: 194630
Diffstat (limited to 'llvm/lib/Target/Mips')
-rw-r--r--llvm/lib/Target/Mips/MipsConstantIslandPass.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp b/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp
index c40b7fe39b8..c46bbacf658 100644
--- a/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp
+++ b/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp
@@ -417,13 +417,11 @@ bool MipsConstantIslands::runOnMachineFunction(MachineFunction &mf) {
DEBUG(dbgs() << "Beginning BR iteration #" << NoBRIters << '\n');
bool BRChange = false;
-#ifdef IN_PROGRESS
for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i)
BRChange |= fixupImmediateBr(ImmBranches[i]);
if (BRChange && ++NoBRIters > 30)
report_fatal_error("Branch Fix Up pass failed to converge!");
DEBUG(dumpBBs());
-#endif
if (!CPChange && !BRChange)
break;
MadeChange = true;
@@ -588,7 +586,6 @@ initializeFunctionInfo(const std::vector<MachineInstr*> &CPEMIs) {
continue;
int Opc = I->getOpcode();
-#ifdef IN_PROGRESS
if (I->isBranch()) {
bool isCond = false;
unsigned Bits = 0;
@@ -596,13 +593,21 @@ initializeFunctionInfo(const std::vector<MachineInstr*> &CPEMIs) {
int UOpc = Opc;
switch (Opc) {
default:
- continue; // Ignore other JT branches
+ continue; // Ignore other branches for now
+ case Mips::Bimm16:
+ Bits = 11;
+ Scale = 2;
+ isCond = false;
+ break;
+ case Mips::BimmX16:
+ Bits = 16;
+ Scale = 2;
+ isCond = false;
}
// Record this immediate branch.
unsigned MaxOffs = ((1 << (Bits-1))-1) * Scale;
ImmBranches.push_back(ImmBranch(I, MaxOffs, isCond, UOpc));
}
-#endif
if (Opc == Mips::CONSTPOOL_ENTRY)
continue;
OpenPOWER on IntegriCloud