[llvm-commits] [llvm] r119457 - /llvm/trunk/lib/Transforms/Utils/Local.cpp
Duncan Sands
baldrick at free.fr
Tue Nov 16 20:12:05 PST 2010
Author: baldrick
Date: Tue Nov 16 22:12:05 2010
New Revision: 119457
URL: http://llvm.org/viewvc/llvm-project?rev=119457&view=rev
Log:
Have RemovePredecessorAndSimplify you SimplifyInstruction
rather than hasConstantValue.
Modified:
llvm/trunk/lib/Transforms/Utils/Local.cpp
Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=119457&r1=119456&r2=119457&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Tue Nov 16 22:12:05 2010
@@ -346,13 +346,13 @@
WeakVH PhiIt = &BB->front();
while (PHINode *PN = dyn_cast<PHINode>(PhiIt)) {
PhiIt = &*++BasicBlock::iterator(cast<Instruction>(PhiIt));
-
- Value *PNV = PN->hasConstantValue();
+
+ Value *PNV = SimplifyInstruction(PN, TD);
if (PNV == 0) continue;
-
+
// If we're able to simplify the phi to a single value, substitute the new
// value into all of its uses.
- assert(PNV != PN && "hasConstantValue broken");
+ assert(PNV != PN && "SimplifyInstruction broken!");
Value *OldPhiIt = PhiIt;
ReplaceAndSimplifyAllUses(PN, PNV, TD);
More information about the llvm-commits
mailing list