[llvm] r195975 - Fixed issue with microMIPS long branch.
Zoran Jovanovic
zoran.jovanovic at imgtec.com
Sat Nov 30 11:12:29 PST 2013
Author: zjovanovic
Date: Sat Nov 30 13:12:28 2013
New Revision: 195975
URL: http://llvm.org/viewvc/llvm-project?rev=195975&view=rev
Log:
Fixed issue with microMIPS long branch.
Modified:
llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp?rev=195975&r1=195974&r2=195975&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp Sat Nov 30 13:12:28 2013
@@ -437,8 +437,10 @@ bool MipsLongBranch::runOnMachineFunctio
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;
More information about the llvm-commits
mailing list