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 | 257efb2ad3fc2707f955a6dd0ab543ae02191191 (patch) | |
tree | fc0e208f42335094bcf470831ceb998679dc5b32 /llvm/lib | |
parent | 1d8b24878f4440dbb4eae1bc020d6e802edbc37d (diff) | |
download | bcm5719-llvm-257efb2ad3fc2707f955a6dd0ab543ae02191191.tar.gz bcm5719-llvm-257efb2ad3fc2707f955a6dd0ab543ae02191191.zip |
This code can handle non-dominating instructions
llvm-svn: 22667
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopSimplify.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopSimplify.cpp b/llvm/lib/Transforms/Scalar/LoopSimplify.cpp index 5ddcc4163db..da1a6550a49 100644 --- a/llvm/lib/Transforms/Scalar/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/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/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index bb7f8680933..d6e6b6cbb1a 100644 --- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/llvm/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]); |