-
Notifications
You must be signed in to change notification settings - Fork 25
WI #2014 Add basic dominator algorithms #2015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| if (n == this.RootBlock.Index) | ||
| continue; | ||
| BasicBlock<N, D> b = this.AllBlocks[n]; | ||
| if (b.PredecessorEdges == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it a Debug.Assert instead ? We ensure that predecessor edges are set with previous call to SetupPredecessorEdgesFromRoot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in
ff21062
| BitSet doms = dominators[i]; | ||
| if (doms != null) | ||
| { | ||
| BasicBlock<N, D> b = this.AllBlocks[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is b.Index not always equal to i ? Intuitively I thought that this method should be static because it does not depend on the current CFG (except if we include other info from the block).
Also why the double braces ? Is it a common notation ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes done in
d9ea371
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and
9dcd9e1 double bracket removed
What has been done
Basic dominator algorithms have been added.
Possible Improvement
Later use faster dominator algorithm, but much more complicate to develop and to understand.