Skip to content

Move assumption/assertion generation to its own pass#496

Merged
rachitnigam merged 12 commits intomainfrom
rangecheck
Apr 30, 2025
Merged

Move assumption/assertion generation to its own pass#496
rachitnigam merged 12 commits intomainfrom
rangecheck

Conversation

@UnsignedByte
Copy link
Collaborator

This PR divests core assumption/assertion generation (about event constraints, param constraints, and range constraints) from astconv. This cleans up astconv a bit and also adds the important ability for the IR to generate its own assertions necessary for discharging. This will be useful in scheduling and is also necessary if we want to be able to discharge after monomorphization properly.

@UnsignedByte
Copy link
Collaborator Author

@rachitnigam There is some finicky stuff here caused by the fact that Visitor does an std::mem::take on the component being visited, so in order to deal with recursive components we do some special checks.

Copy link
Member

@rachitnigam rachitnigam left a comment

Choose a reason for hiding this comment

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

Seems cool! I'm curious if this basically brings us back to the old world where the well-formed pass would add all of the assumptions and they could be discharged later?

@UnsignedByte
Copy link
Collaborator Author

Seems cool! I'm curious if this basically brings us back to the old world where the well-formed pass would add all of the assumptions and they could be discharged later?

Yes this is the goal hopefully, the nice thing about this is we can now on-the-fly generate all the assertions/assumptions that are important and then something like scheduling can just work directly off these.

@rachitnigam
Copy link
Member

Awesome! Merge whenever!

@rachitnigam rachitnigam merged commit a2d3282 into main Apr 30, 2025
4 checks passed
@rachitnigam rachitnigam deleted the rangecheck branch April 30, 2025 20:06
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