mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +00:00
Handle the case when block dominates itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37773 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
eb62eca503
commit
dc3a207e78
@ -185,7 +185,7 @@ protected:
|
||||
const DomTreeNode *B) const {
|
||||
const DomTreeNode *IDom;
|
||||
if (A == 0 || B == 0) return false;
|
||||
while ((IDom = B->getIDom()) != 0 && IDom != A)
|
||||
while ((IDom = B->getIDom()) != 0 && IDom != A && IDom != B)
|
||||
B = IDom; // Walk up the tree
|
||||
return IDom != 0;
|
||||
}
|
||||
@ -244,6 +244,9 @@ protected:
|
||||
DomTreeNode *addNewBlock(BasicBlock *BB, BasicBlock *DomBB) {
|
||||
assert(getNode(BB) == 0 && "Block already in dominator tree!");
|
||||
DomTreeNode *IDomNode = getNode(DomBB);
|
||||
// Check if BB dominates itself.
|
||||
//if (!IDomNode && BB == DomBB)
|
||||
// IDomNode = BB;
|
||||
assert(IDomNode && "Not immediate dominator specified for block!");
|
||||
DFSInfoValid = false;
|
||||
return DomTreeNodes[BB] =
|
||||
|
Loading…
Reference in New Issue
Block a user