[llvm-commits] [llvm] r171538 - /llvm/trunk/lib/CodeGen/MachineInstrBundle.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Jan 4 14:17:31 PST 2013


Author: stoklund
Date: Fri Jan  4 16:17:31 2013
New Revision: 171538

URL: http://llvm.org/viewvc/llvm-project?rev=171538&view=rev
Log:
Move an assertion so it doesn't dereference end().

The R600 target has test cases that exercises this code.

Modified:
    llvm/trunk/lib/CodeGen/MachineInstrBundle.cpp

Modified: llvm/trunk/lib/CodeGen/MachineInstrBundle.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstrBundle.cpp?rev=171538&r1=171537&r2=171538&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstrBundle.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstrBundle.cpp Fri Jan  4 16:17:31 2013
@@ -224,14 +224,13 @@
   bool Changed = false;
   for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
     MachineBasicBlock &MBB = *I;
-
     MachineBasicBlock::instr_iterator MII = MBB.instr_begin();
-    assert(!MII->isInsideBundle() &&
-           "First instr cannot be inside bundle before finalization!");
-
     MachineBasicBlock::instr_iterator MIE = MBB.instr_end();
     if (MII == MIE)
       continue;
+    assert(!MII->isInsideBundle() &&
+           "First instr cannot be inside bundle before finalization!");
+
     for (++MII; MII != MIE; ) {
       if (!MII->isInsideBundle())
         ++MII;





More information about the llvm-commits mailing list