summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/CondPropagate.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-08-04 23:24:19 +0000
committerNate Begeman <natebegeman@mac.com>2005-08-04 23:24:19 +0000
commitb392321cae84aa9ac37966ce0d3f73a34bee8b11 (patch)
tree1dd95fa0d70c36c83a8b37e5f5dc4c77d15b8c56 /llvm/lib/Transforms/Scalar/CondPropagate.cpp
parenta75342d89f59426934ed634a15c6585197ff55cc (diff)
downloadbcm5719-llvm-b392321cae84aa9ac37966ce0d3f73a34bee8b11.tar.gz
bcm5719-llvm-b392321cae84aa9ac37966ce0d3f73a34bee8b11.zip
Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization into
BasicBlock's removePredecessor routine. This requires shuffling around the definition and implementation of hasContantValue from Utils.h,cpp into Instructions.h,cpp llvm-svn: 22664
Diffstat (limited to 'llvm/lib/Transforms/Scalar/CondPropagate.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/CondPropagate.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Scalar/CondPropagate.cpp b/llvm/lib/Transforms/Scalar/CondPropagate.cpp
index d3ad5778bb4..101acef6dcb 100644
--- a/llvm/lib/Transforms/Scalar/CondPropagate.cpp
+++ b/llvm/lib/Transforms/Scalar/CondPropagate.cpp
@@ -80,17 +80,6 @@ void CondProp::SimplifyBlock(BasicBlock *BB) {
SimplifyPredecessors(SI);
}
- // See if we can fold any PHI nodes in this block now.
- // FIXME: This would not be required if removePredecessor did this for us!!
- PHINode *PN;
- for (BasicBlock::iterator I = BB->begin(); (PN = dyn_cast<PHINode>(I++)); )
- if (Value *PNV = hasConstantValue(PN))
- if (!isa<Instruction>(PNV)) {
- PN->replaceAllUsesWith(PNV);
- PN->eraseFromParent();
- MadeChange = true;
- }
-
// If possible, simplify the terminator of this block.
if (ConstantFoldTerminator(BB))
MadeChange = true;
OpenPOWER on IntegriCloud