[llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Aug 4 18:02:15 PDT 2005
Changes in directory llvm/lib/VMCore:
BasicBlock.cpp updated: 1.65 -> 1.66
---
Log message:
Now that hasConstantValue is more careful w.r.t. returning values that only
dominate the PHI node, this code can go away. This also makes passes more
aggressive, e.g. implementing Transforms/CondProp/phisimplify2.ll
---
Diffs of the changes: (+4 -5)
BasicBlock.cpp | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
Index: llvm/lib/VMCore/BasicBlock.cpp
diff -u llvm/lib/VMCore/BasicBlock.cpp:1.65 llvm/lib/VMCore/BasicBlock.cpp:1.66
--- llvm/lib/VMCore/BasicBlock.cpp:1.65 Thu Aug 4 18:24:19 2005
+++ llvm/lib/VMCore/BasicBlock.cpp Thu Aug 4 20:02:04 2005
@@ -193,11 +193,10 @@
PN->removeIncomingValue(Pred, false);
// If all incoming values to the Phi are the same, we can replace the Phi
// with that value.
- if (Value *PNV = PN->hasConstantValue())
- if (!isa<Instruction>(PNV)) {
- PN->replaceAllUsesWith(PNV);
- PN->eraseFromParent();
- }
+ if (Value *PNV = PN->hasConstantValue()) {
+ PN->replaceAllUsesWith(PNV);
+ PN->eraseFromParent();
+ }
}
}
}
More information about the llvm-commits
mailing list