summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/ADCE.cpp
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2005-04-21 23:48:37 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2005-04-21 23:48:37 +0000
commitfd93908ae8b9684fe71c239e3c6cfe13ff6a2663 (patch)
tree4d0726d997a629d08765d11a705a42c4f48690af /lib/Transforms/Scalar/ADCE.cpp
parent0e0a7a45d3d0a8c865a078459d2e1c6d8967a100 (diff)
downloadllvm-fd93908ae8b9684fe71c239e3c6cfe13ff6a2663.tar.gz
llvm-fd93908ae8b9684fe71c239e3c6cfe13ff6a2663.tar.bz2
llvm-fd93908ae8b9684fe71c239e3c6cfe13ff6a2663.tar.xz
Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/ADCE.cpp')
-rw-r--r--lib/Transforms/Scalar/ADCE.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp
index 089124a87f..a2ca367c45 100644
--- a/lib/Transforms/Scalar/ADCE.cpp
+++ b/lib/Transforms/Scalar/ADCE.cpp
@@ -1,14 +1,14 @@
//===- ADCE.cpp - Code to perform aggressive dead code elimination --------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements "aggressive" dead code elimination. ADCE is DCe where
-// values are assumed to be dead until proven otherwise. This is similar to
+// values are assumed to be dead until proven otherwise. This is similar to
// SCCP, except applied to the liveness of values.
//
//===----------------------------------------------------------------------===//
@@ -116,11 +116,11 @@ void ADCE::markBlockAlive(BasicBlock *BB) {
if (It != CDG.end()) {
// Get the blocks that this node is control dependent on...
const PostDominanceFrontier::DomSetType &CDB = It->second;
- for (PostDominanceFrontier::DomSetType::const_iterator I =
+ for (PostDominanceFrontier::DomSetType::const_iterator I =
CDB.begin(), E = CDB.end(); I != E; ++I)
markTerminatorLive(*I); // Mark all their terminators as live
}
-
+
// If this basic block is live, and it ends in an unconditional branch, then
// the branch is alive as well...
if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator()))
@@ -162,7 +162,7 @@ TerminatorInst *ADCE::convertToUnconditionalBranch(TerminatorInst *TI) {
// Remove entries from PHI nodes to avoid confusing ourself later...
for (unsigned i = 1, e = TI->getNumSuccessors(); i != e; ++i)
TI->getSuccessor(i)->removePredecessor(BB);
-
+
// Delete the old branch itself...
BB->getInstList().erase(TI);
return NB;
@@ -203,7 +203,7 @@ bool ADCE::doADCE() {
}
// Iterate over all of the instructions in the function, eliminating trivially
- // dead instructions, and marking instructions live that are known to be
+ // dead instructions, and marking instructions live that are known to be
// needed. Perform the walk in depth first order so that we avoid marking any
// instructions live in basic blocks that are unreachable. These blocks will
// be eliminated later, along with the instructions inside.
@@ -338,7 +338,7 @@ bool ADCE::doADCE() {
return MadeChanges;
}
-
+
// If the entry node is dead, insert a new entry node to eliminate the entry
// node as a special case.
@@ -350,7 +350,7 @@ bool ADCE::doADCE() {
AliveBlocks.insert(NewEntry); // This block is always alive!
LiveSet.insert(NewEntry->getTerminator()); // The branch is live
}
-
+
// Loop over all of the alive blocks in the function. If any successor
// blocks are not alive, we adjust the outgoing branches to branch to the
// first live postdominator of the live block, adjusting any PHI nodes in
@@ -360,7 +360,7 @@ bool ADCE::doADCE() {
if (AliveBlocks.count(I)) {
BasicBlock *BB = I;
TerminatorInst *TI = BB->getTerminator();
-
+
// If the terminator instruction is alive, but the block it is contained
// in IS alive, this means that this terminator is a conditional branch on
// a condition that doesn't matter. Make it an unconditional branch to
@@ -392,7 +392,7 @@ bool ADCE::doADCE() {
break;
}
}
- }
+ }
// There is a special case here... if there IS no post-dominator for
// the block we have nowhere to point our branch to. Instead, convert
@@ -411,12 +411,12 @@ bool ADCE::doADCE() {
// branch into an infinite loop into a return instruction!
//
RemoveSuccessor(TI, i);
-
+
// RemoveSuccessor may replace TI... make sure we have a fresh
// pointer.
//
TI = BB->getTerminator();
-
+
// Rescan this successor...
--i;
} else {
@@ -443,7 +443,7 @@ bool ADCE::doADCE() {
int OldIdx = PN->getBasicBlockIndex(LastDead);
assert(OldIdx != -1 &&"LastDead is not a pred of NextAlive!");
Value *InVal = PN->getIncomingValue(OldIdx);
-
+
// Add an incoming value for BB now...
PN->addIncoming(InVal, BB);
}