summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-07-06 02:31:22 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-07-06 02:31:22 +0000
commit3f1bb93cabcea1fbb2462225e5e2bdbeb4b4bc00 (patch)
tree085184496306f2ebd062c0f0da8fe0023d62feb1 /llvm/lib
parent84d32ddfc8593e15c7ea95468abe2a322f0b38d1 (diff)
downloadbcm5719-llvm-3f1bb93cabcea1fbb2462225e5e2bdbeb4b4bc00.tar.gz
bcm5719-llvm-3f1bb93cabcea1fbb2462225e5e2bdbeb4b4bc00.zip
Add some comments suggested in code review.
llvm-svn: 159800
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/EarlyIfConversion.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/EarlyIfConversion.cpp b/llvm/lib/CodeGen/EarlyIfConversion.cpp
index f575b249aa1..effddfbbad2 100644
--- a/llvm/lib/CodeGen/EarlyIfConversion.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud