aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commit6ac3386e100db376895dbc4a324d56d0ecd666d2 (patch)
tree8bc285d8df3ca3a70486bb4d3e77afaac9ad1963 /lib
parentd32c4a1756b3c236b7f96cf11ba61e78ceb862bc (diff)
downloadexternal_llvm-6ac3386e100db376895dbc4a324d56d0ecd666d2.zip
external_llvm-6ac3386e100db376895dbc4a324d56d0ecd666d2.tar.gz
external_llvm-6ac3386e100db376895dbc4a324d56d0ecd666d2.tar.bz2
Have RemovePredecessorAndSimplify you SimplifyInstruction
rather than hasConstantValue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Utils/Local.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp
index 52f0499..031bb4b 100644
--- a/lib/Transforms/Utils/Local.cpp
+++ b/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);