[llvm] r176326 - [mips] Do not add SecondLastInst to list BranchInstrs if there is only one

Akira Hatanaka ahatanaka at mips.com
Thu Feb 28 17:22:26 PST 2013


Author: ahatanak
Date: Thu Feb 28 19:22:26 2013
New Revision: 176326

URL: http://llvm.org/viewvc/llvm-project?rev=176326&view=rev
Log:
[mips] Do not add SecondLastInst to list BranchInstrs if there is only one
terminator.

No functionality change.

Modified:
    llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp

Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp?rev=176326&r1=176325&r2=176326&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.cpp Thu Feb 28 19:22:26 2013
@@ -226,8 +226,6 @@ AnalyzeBranch(MachineBasicBlock &MBB, Ma
       return BT_None;
   }
 
-  BranchInstrs.insert(BranchInstrs.begin(), SecondLastInst);
-
   // If there is only one terminator instruction, process it.
   if (!SecondLastOpc) {
     // Unconditional branch
@@ -246,6 +244,8 @@ AnalyzeBranch(MachineBasicBlock &MBB, Ma
   if (++I != REnd && isUnpredicatedTerminator(&*I))
     return BT_None;
 
+  BranchInstrs.insert(BranchInstrs.begin(), SecondLastInst);
+
   // If second to last instruction is an unconditional branch,
   // analyze it and remove the last instruction.
   if (SecondLastOpc == UncondBrOpc) {





More information about the llvm-commits mailing list