diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-07-06 02:31:22 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-07-06 02:31:22 +0000 |
commit | 86fc3100b552c8d400160581c2a00f2fd7b83b45 (patch) | |
tree | 413a30e7668cadf5bccdf6754ef717ec4cc95720 | |
parent | 0da21789b3b1b51dbdf3e6ea5682a8508e747ca9 (diff) | |
download | external_llvm-86fc3100b552c8d400160581c2a00f2fd7b83b45.zip external_llvm-86fc3100b552c8d400160581c2a00f2fd7b83b45.tar.gz external_llvm-86fc3100b552c8d400160581c2a00f2fd7b83b45.tar.bz2 |
Add some comments suggested in code review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159800 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/EarlyIfConversion.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/EarlyIfConversion.cpp b/lib/CodeGen/EarlyIfConversion.cpp index f575b24..effddfb 100644 --- a/lib/CodeGen/EarlyIfConversion.cpp +++ b/lib/CodeGen/EarlyIfConversion.cpp @@ -167,6 +167,9 @@ bool SSAIfConv::canSpeculateInstrs(MachineBasicBlock *MBB) { } 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 EarlyIfConverter::runOnMachineFunction(MachineFunction &MF) { 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()); |