From 304964c1031372b6714e48199a021c345d132372 Mon Sep 17 00:00:00 2001 From: Zoran Jovanovic Date: Sat, 30 Nov 2013 19:12:28 +0000 Subject: Fixed issue with microMIPS long branch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195975 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Mips/MipsLongBranch.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/Target/Mips/MipsLongBranch.cpp') diff --git a/lib/Target/Mips/MipsLongBranch.cpp b/lib/Target/Mips/MipsLongBranch.cpp index ea8cc80283..2efe57847a 100644 --- a/lib/Target/Mips/MipsLongBranch.cpp +++ b/lib/Target/Mips/MipsLongBranch.cpp @@ -437,8 +437,10 @@ bool MipsLongBranch::runOnMachineFunction(MachineFunction &F) { if (!I->Br || I->HasLongBranch) continue; + int ShVal = TM.getSubtarget().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; -- cgit v1.2.3