[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Dec 12 14:44:45 PST 2004
Changes in directory llvm/lib/Transforms/Scalar:
ADCE.cpp updated: 1.85 -> 1.86
---
Log message:
More minor microoptimizations
---
Diffs of the changes: (+4 -6)
Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.85 llvm/lib/Transforms/Scalar/ADCE.cpp:1.86
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.85 Sun Dec 12 16:22:18 2004
+++ llvm/lib/Transforms/Scalar/ADCE.cpp Sun Dec 12 16:44:30 2004
@@ -264,8 +264,6 @@
for (pred_iterator PI = pred_begin(I), E = pred_end(I); PI != E; ++PI)
markInstructionLive((*PI)->getTerminator());
-
-
DEBUG(std::cerr << "Processing work list\n");
// AliveBlocks - Set of basic blocks that we know have instructions that are
@@ -291,12 +289,12 @@
// makes the predecessors alive.
//
if (PHINode *PN = dyn_cast<PHINode>(I))
- for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE; ++PI)
- if (AliveBlocks.insert(*PI).second) // Block is now ALIVE!
- markBlockAlive(*PI);
+ for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
+ if (AliveBlocks.insert(PN->getIncomingBlock(i)).second)
+ markBlockAlive(PN->getIncomingBlock(i)); // Block is newly ALIVE!
// Loop over all of the operands of the live instruction, making sure that
- // they are known to be alive as well...
+ // they are known to be alive as well.
//
for (unsigned op = 0, End = I->getNumOperands(); op != End; ++op)
if (Instruction *Operand = dyn_cast<Instruction>(I->getOperand(op)))
More information about the llvm-commits
mailing list