mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Don't call dominates on unreachable instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151466 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6fd3428afa
commit
8c727f9200
@ -820,7 +820,7 @@ public:
|
||||
DT->splitBlock(NewBB);
|
||||
}
|
||||
|
||||
bool isReachableFromEntry(const BasicBlock* A) {
|
||||
bool isReachableFromEntry(const BasicBlock* A) const {
|
||||
return DT->isReachableFromEntry(A);
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,8 @@ static bool ValueDominatesPHI(Value *V, PHINode *P, const DominatorTree *DT) {
|
||||
|
||||
// If we have a DominatorTree then do a precise test.
|
||||
if (DT)
|
||||
return DT->dominates(I, P);
|
||||
return !DT->isReachableFromEntry(P->getParent()) ||
|
||||
!DT->isReachableFromEntry(I->getParent()) || DT->dominates(I, P);
|
||||
|
||||
// Otherwise, if the instruction is in the entry block, and is not an invoke,
|
||||
// then it obviously dominates all phi nodes.
|
||||
|
Loading…
Reference in New Issue
Block a user