[llvm-commits] [llvm] r159800 - /llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Jul 5 19:31:23 PDT 2012


Author: stoklund
Date: Thu Jul  5 21:31:22 2012
New Revision: 159800

URL: http://llvm.org/viewvc/llvm-project?rev=159800&view=rev
Log:
Add some comments suggested in code review.

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

Modified: llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp?rev=159800&r1=159799&r2=159800&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp (original)
+++ llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp Thu Jul  5 21:31:22 2012
@@ -167,6 +167,9 @@
   }
 
   unsigned InstrCount = 0;
+
+  // Check all instructions, except the terminators. It is assumed that
+  // terminators never have side effects or define any used register values.
   for (MachineBasicBlock::iterator I = MBB->begin(),
        E = MBB->getFirstTerminator(); I != E; ++I) {
     if (I->isDebugValue())
@@ -569,11 +572,15 @@
   bool Changed = false;
   IfConv.runOnMachineFunction(MF);
 
+  // Initially visit blocks in layout order. The tryConvertIf() function may
+  // erase blocks, but never the head block passed as MFI.
   for (MachineFunction::iterator MFI = MF.begin(), MFE = MF.end(); MFI != MFE;
        ++MFI)
     if (tryConvertIf(MFI))
       Changed = true;
 
+  // Revisit blocks identified by tryConvertIf() as candidates for nested
+  // if-conversion.
   DEBUG(dbgs() << "Revisiting " << WorkList.size() << " blocks.\n");
   while (!WorkList.empty())
     tryConvertIf(WorkList.pop_back_val());





More information about the llvm-commits mailing list