Make MipsLongBranch::runOnMachineFunction return true.
authorAkira Hatanaka <ahatanaka@mips.com>
Tue, 19 Jun 2012 03:45:29 +0000 (03:45 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Tue, 19 Jun 2012 03:45:29 +0000 (03:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158702 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsLongBranch.cpp

index 978c49ab30b194c24f31d7e752c2a78000744732..7be353f1901243e60e578abc2485b8681057e02c 100644 (file)
@@ -375,7 +375,7 @@ bool MipsLongBranch::runOnMachineFunction(MachineFunction &F) {
     emitGPDisp(F, TII);
 
   if (SkipLongBranch)
-    return false;
+    return true;
 
   MF = &F;
   initMBBInfo();
@@ -393,9 +393,9 @@ bool MipsLongBranch::runOnMachineFunction(MachineFunction &F) {
       if (!I->Br || I->HasLongBranch)
         continue;
 
-      int64_t Offset = computeOffset(I->Br);
-
       if (!ForceLongBranch) {
+        int64_t Offset = computeOffset(I->Br);
+
         // Check if offset fits into 16-bit immediate field of branches.
         if ((I->Br->isConditionalBranch() || IsPIC) && isInt<16>(Offset / 4))
           continue;
@@ -414,5 +414,5 @@ bool MipsLongBranch::runOnMachineFunction(MachineFunction &F) {
   if (EverMadeChange)
     MF->RenumberBlocks();
 
-  return EverMadeChange;
+  return true;
 }