summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-11-17 04:12:05 +0000
committerDuncan Sands <baldrick@free.fr>2010-11-17 04:12:05 +0000
commitba0b22c785a1744b16abfe69720396feffc77871 (patch)
treef80ad9000314851da7d920cabf29f96a6a237834 /llvm/lib/Transforms/Utils/Local.cpp
parent72313843d5f4b5d42114f0ea23c539ca76eff7c3 (diff)
downloadbcm5719-llvm-ba0b22c785a1744b16abfe69720396feffc77871.tar.gz
bcm5719-llvm-ba0b22c785a1744b16abfe69720396feffc77871.zip
Have RemovePredecessorAndSimplify you SimplifyInstruction
rather than hasConstantValue. llvm-svn: 119457
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 52f0499f39b..031bb4ba1b1 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -346,13 +346,13 @@ void llvm::RemovePredecessorAndSimplify(BasicBlock *BB, BasicBlock *Pred,
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);
OpenPOWER on IntegriCloud