mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-30 17:33:24 +00:00
Now that hasConstantValue has been made simpler, it may return the
phi node itself if it occurs in an unreachable basic block. Protect against this. Hopefully this will fix some more buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119493 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
baa45f7298
commit
23a19572b2
@ -583,6 +583,7 @@ Value *Lint::findValueImpl(Value *V, bool OffsetOk,
|
||||
}
|
||||
} else if (PHINode *PN = dyn_cast<PHINode>(V)) {
|
||||
if (Value *W = PN->hasConstantValue())
|
||||
if (W != V)
|
||||
return findValueImpl(W, OffsetOk, Visited);
|
||||
} else if (CastInst *CI = dyn_cast<CastInst>(V)) {
|
||||
if (CI->isNoopCast(TD ? TD->getIntPtrType(V->getContext()) :
|
||||
|
@ -248,7 +248,8 @@ void BasicBlock::removePredecessor(BasicBlock *Pred,
|
||||
// If all incoming values to the Phi are the same, we can replace the Phi
|
||||
// with that value.
|
||||
Value* PNV = 0;
|
||||
if (!DontDeleteUselessPHIs && (PNV = PN->hasConstantValue())) {
|
||||
if (!DontDeleteUselessPHIs && (PNV = PN->hasConstantValue()))
|
||||
if (PNV != PN) {
|
||||
PN->replaceAllUsesWith(PNV);
|
||||
PN->eraseFromParent();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user