diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-05 00:57:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-05 00:57:45 +0000 |
commit | 5e1b23192184aadbfbd79a31641eb3c0c0ecdc05 (patch) | |
tree | aa9afc0730d1fd37fd9cea66896d8bf1eac2bf3e /lib/Transforms/Utils | |
parent | 9acbd611ec13fabf3c13f20161c0de576ea1ad60 (diff) | |
download | llvm-5e1b23192184aadbfbd79a31641eb3c0c0ecdc05.tar.gz llvm-5e1b23192184aadbfbd79a31641eb3c0c0ecdc05.tar.bz2 llvm-5e1b23192184aadbfbd79a31641eb3c0c0ecdc05.tar.xz |
This code can handle non-dominating instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22667 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/LoopSimplify.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index 5ddcc4163d..da1a6550a4 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -256,7 +256,7 @@ BasicBlock *LoopSimplify::SplitBlockPredecessors(BasicBlock *BB, PN->addIncoming(InVal, NewBB); // Can we eliminate this phi node now? - if (Value *V = PN->hasConstantValue()) { + if (Value *V = PN->hasConstantValue(true)) { if (!isa<Instruction>(V) || getAnalysis<DominatorSet>().dominates(cast<Instruction>(V), PN)) { PN->replaceAllUsesWith(V); diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index bb7f868093..d6e6b6cbb1 100644 --- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -347,7 +347,7 @@ void PromoteMem2Reg::run() { PHINode *SomePHI = 0; for (unsigned i = 0, e = PNs.size(); i != e; ++i) if (PNs[i]) { - if (Value *V = PNs[i]->hasConstantValue()) { + if (Value *V = PNs[i]->hasConstantValue(true)) { if (!isa<Instruction>(V) || dominates(cast<Instruction>(V), PNs[i])) { if (AST && isa<PointerType>(PNs[i]->getType())) AST->deleteValue(PNs[i]); |