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

Extractor that removes dead code in if inputs #712

Merged
merged 25 commits into from
Feb 10, 2025

Conversation

oflatt
Copy link
Member

@oflatt oflatt commented Jan 27, 2025

This PR adds a special case to the extractor that adds "DeadCode" nodes to the resulting AST

Then, a new pass removes these dead code expressions

It also adds typechecking between compiler passes to catch more bugs

@oflatt oflatt requested review from yihozhang and ajpal January 27, 2025 19:38
@yihozhang
Copy link
Collaborator

CI seems to time out

@oflatt oflatt force-pushed the oflatt-dead-code-aware-extractor branch from 7a3f541 to df21ada Compare February 3, 2025 19:44
@oflatt oflatt force-pushed the oflatt-dead-code-aware-extractor branch from c77aefb to 9300d42 Compare February 5, 2025 20:50
Copy link
Collaborator

@yihozhang yihozhang left a comment

Choose a reason for hiding this comment

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

Great work! There are still many details I don't understand, but looking at the snapshots and tests, I tentatively approve so that merging is not blocked. Does this PR make the nightly numbers better?

let mut node_to_type: IndexMap<ClassId, Type> = Default::default();

for (term, node_id) in &self.correspondence {
for (term, node_id) in &self.correspondence.clone() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is compute_eclass_types only called once so this clone is acceptable? Can we get rid of this clone?

Copy link
Member Author

Choose a reason for hiding this comment

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

good question, but probably not blocking
busy writing paper!

@oflatt oflatt merged commit 2569ffb into main Feb 10, 2025
4 checks passed
@oflatt oflatt deleted the oflatt-dead-code-aware-extractor branch February 10, 2025 16:36
@oflatt
Copy link
Member Author

oflatt commented Feb 10, 2025

Doesn't make the nightly numbers better but does help with Anjali's examples in the overview

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