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

Rework the removal of dynamic checks #129

Merged
merged 6 commits into from
May 6, 2024
Merged

Rework the removal of dynamic checks #129

merged 6 commits into from
May 6, 2024

Conversation

Nadrieril
Copy link
Member

@Nadrieril Nadrieril commented Apr 17, 2024

To avoid interference with other passes, we do this one earlier on ullbc. We no longer remove overflow checks in const blocks because they're tricky to remove and will be evaluated anyway. I also had to distinguish checked from unchecked binary operations.

Fixes #125

@Nadrieril Nadrieril force-pushed the dyn-checks-earlier branch 3 times, most recently from 6c6b114 to fc096a0 Compare April 19, 2024 13:36
@Nadrieril Nadrieril marked this pull request as ready for review April 19, 2024 13:36
@Nadrieril Nadrieril requested a review from sonmarcho April 19, 2024 13:44
@Nadrieril

This comment was marked as resolved.

@Nadrieril Nadrieril removed the request for review from sonmarcho April 20, 2024 13:50
@Nadrieril Nadrieril marked this pull request as draft April 20, 2024 13:50
@Nadrieril Nadrieril force-pushed the dyn-checks-earlier branch 5 times, most recently from 8cc86a7 to 2335415 Compare April 22, 2024 09:29
@Nadrieril Nadrieril marked this pull request as ready for review April 22, 2024 09:30
@Nadrieril Nadrieril requested a review from sonmarcho April 22, 2024 11:18
Copy link
Member

@sonmarcho sonmarcho left a comment

Choose a reason for hiding this comment

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

This is a lot cleaner, thanks!
Can you:

  • open an issue for the constants case?
  • locally check that the code generated by Aeneas is unchanged?
    After this, you're free to merge.

charon/src/driver.rs Show resolved Hide resolved
charon/src/expressions.rs Outdated Show resolved Hide resolved
charon/tests/ui/remove-dynamic-checks.out Show resolved Hide resolved
charon/src/transform/remove_dynamic_checks.rs Show resolved Hide resolved
charon/src/transform/remove_dynamic_checks.rs Outdated Show resolved Hide resolved
@Nadrieril
Copy link
Member Author

I opened #142 and checked aeneas locally.

@Nadrieril
Copy link
Member Author

Nadrieril commented Apr 23, 2024

This may be breaking Eurydice (as #138 breaks Eurydice and is based on this). I haven't had time to investigate

@sonmarcho
Copy link
Member

You can merge when you want.
@protz: this may break Eurydice.

@Nadrieril Nadrieril force-pushed the dyn-checks-earlier branch 2 times, most recently from aa48c03 to 346237a Compare April 23, 2024 15:21
@Nadrieril
Copy link
Member Author

This also breaks const MONTGOMERY_R: i32 = 1 << MONTGOMERY_SHIFT;. I'll leave this as draft for now

@Nadrieril Nadrieril marked this pull request as draft April 24, 2024 12:19
@Nadrieril Nadrieril force-pushed the dyn-checks-earlier branch 2 times, most recently from 91b195a to 21e74b1 Compare April 30, 2024 13:36
@Nadrieril Nadrieril force-pushed the dyn-checks-earlier branch from 21e74b1 to e952cff Compare May 3, 2024 14:06
@Nadrieril Nadrieril marked this pull request as ready for review May 3, 2024 14:57
@Nadrieril Nadrieril force-pushed the dyn-checks-earlier branch 2 times, most recently from 1848f74 to 2a73f37 Compare May 3, 2024 15:22
@Nadrieril Nadrieril force-pushed the dyn-checks-earlier branch from 2a73f37 to 9f950c1 Compare May 3, 2024 15:51
@Nadrieril Nadrieril marked this pull request as draft May 3, 2024 16:23
@Nadrieril
Copy link
Member Author

Alright, this is blocked until I can figure out how to implement the new Checked* binops for all backends

@Nadrieril Nadrieril force-pushed the dyn-checks-earlier branch from 9f950c1 to 036d0d3 Compare May 6, 2024 13:34
@Nadrieril Nadrieril marked this pull request as ready for review May 6, 2024 13:42
@Nadrieril Nadrieril added this pull request to the merge queue May 6, 2024
Merged via the queue into main with commit 1a205c5 May 6, 2024
8 of 10 checks passed
@Nadrieril Nadrieril deleted the dyn-checks-earlier branch May 6, 2024 13:47
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.

Detect overflow checks properly
2 participants