summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorZoran Jovanovic <zoran.jovanovic@imgtec.com>2013-11-30 19:12:28 +0000
committerZoran Jovanovic <zoran.jovanovic@imgtec.com>2013-11-30 19:12:28 +0000
commit9d86e26e62415a50ff9572189b67b34096c43981 (patch)
treec4ad13de1d179964b86e06e7ed9aa14f4e29edc6 /llvm/lib/Target
parent664711188f55d8c721835db48cbbd52c2bb0f0a5 (diff)
downloadbcm5719-llvm-9d86e26e62415a50ff9572189b67b34096c43981.tar.gz
bcm5719-llvm-9d86e26e62415a50ff9572189b67b34096c43981.zip
Fixed issue with microMIPS long branch.
llvm-svn: 195975
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/Mips/MipsLongBranch.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/Mips/MipsLongBranch.cpp b/llvm/lib/Target/Mips/MipsLongBranch.cpp
index ea8cc802835..2efe57847ad 100644
--- a/llvm/lib/Target/Mips/MipsLongBranch.cpp
+++ b/llvm/lib/Target/Mips/MipsLongBranch.cpp
@@ -437,8 +437,10 @@ bool MipsLongBranch::runOnMachineFunction(MachineFunction &F) {
if (!I->Br || I->HasLongBranch)
continue;
+ int ShVal = TM.getSubtarget<MipsSubtarget>().inMicroMipsMode() ? 2 : 4;
+
// Check if offset fits into 16-bit immediate field of branches.
- if (!ForceLongBranch && isInt<16>(computeOffset(I->Br) / 4))
+ if (!ForceLongBranch && isInt<16>(computeOffset(I->Br) / ShVal))
continue;
I->HasLongBranch = true;
OpenPOWER on IntegriCloud