mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-22 10:33:23 +00:00
This code can handle non-dominating instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22667 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9acbd611ec
commit
5e1b231921
@ -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);
|
||||
|
@ -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]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user