Skip to content
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

[ir] Add some comments to implementation of CFG optimizations and analyses #2474

Merged
merged 5 commits into from
Jul 6, 2021

Conversation

xumingkuan
Copy link
Contributor

Related issue = #2193

I think the code of control-flow graph has been documented now -- feel free to tell me if any part is still not clear enough.

@xumingkuan xumingkuan requested a review from k-ye June 29, 2021 06:53
Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -644,6 +642,8 @@ void ControlFlowGraph::reaching_definition_analysis(bool after_lower_access) {
to_visit.push(nodes[i].get());
in_queue[nodes[i].get()] = true;
}

// The worklist algorithm.
while (!to_visit.empty()) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we implement "the worklist algo" as a separate function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(I thought I replied by email 7 days ago but it didn't appear here) Probably no — IIRC the reaching definition analysis and the live variable analysis use opposite (forward/backward) edges in the graph.

@k-ye k-ye merged commit c203871 into taichi-dev:master Jul 6, 2021
@Leonz5288 Leonz5288 mentioned this pull request Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants