-
Notifications
You must be signed in to change notification settings - Fork 4
NO OP rules for compiler hint intrinsics #828
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
Conversation
This also handles `likely` and `unlikely` "intrinsics` that are actually `MonoItemFn`.
jberthold
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and good refactoring to split it out of kmir.md!
BTW we also need assert_inhabited BTW, but implementing its idea requires type information that we don't really have. We can make it a NO OP, though (it "is not guaranteed to ever panic").
| # Rust Intrinsic Functions in K | ||
|
|
||
| ```k | ||
| // This looks like a circular import but only module KMIR in kmir.md imports KMIR-INTRINSICS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should split out the control flow in kmir.md into its own file at some point (not an urgent matter)
|
Needs test adaptation, |
Co-authored-by: Jost Berthold <jost.berthold@gmail.com>
Some instrinsics do not affect the semantics of the compiled program but are hints to the compiler. In our semantics these intrinsics are NO OPs where the call is ignored and current continuation (
<k>cell) moves onto the next term in the sequence.In particular there are rules implemented for these intrinsics:
cold_pathprefetch_read_dataprefetch_write_dataprefetch_read_instructionprefetch_write_instructionBy handling
cold_pathwe also supportlikelyandunlikelywhich areMonoItemFnthat call thecold_pathinstrinic.This PR also refactors the intrinsics into their only file
intrinsics.md.closes #802