Skip to content

C#: Speedup Assertions::strictlyDominates() and ControlFlowElement::controlsBlock() #638

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

Merged
merged 2 commits into from
Dec 18, 2018

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Dec 7, 2018

Only calculate dominance by explicit recursion for split nodes; all other nodes can use regular CFG dominance.

…::controlsBlock()`

Only calculate dominance by explicit recursion for split nodes; all other nodes
can use regular CFG dominance.
@hvitved hvitved added the C# label Dec 7, 2018
@hvitved hvitved requested a review from a team as a code owner December 7, 2018 11:06
Copy link
Contributor

@calumgrant calumgrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One typo, and one suggestion/question.

* This predicate is different from
* `this.getAControlFlowNode().getBasicBlock().(ConditionBlock).immediatelyControls(succ, s)`
* in that it takes control flow splitting into account.
* Moroever, this control flow element corresponds to multiple control flow nodes,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moroever -> Moreover

)
else
this.strictlyDominates(bb.getAPredecessor())
this.getAControlFlowNode().getBasicBlock().strictlyDominates(bb)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does make sense - my only question is whether strictlyDominates belongs in this class - as it seems to be a very general predicate that isn't necessarily tied to class Assertion. Perhaps it should be reversed to bb.isDominatedBy(this) and implemented there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with that approach is that there is then no restriction on the control flow elements to calculate dominance for, and the result will simply be too big. By adding it here, we restrict the calculation to assertions, which is a much smaller subset.

@calumgrant calumgrant merged commit b051b75 into github:master Dec 18, 2018
@hvitved hvitved deleted the csharp/split-dominance-performance branch December 18, 2018 13:07
cklin pushed a commit that referenced this pull request May 23, 2022
Add missing tests for DatabaseSql function models
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants