-
Notifications
You must be signed in to change notification settings - Fork 710
feat: tagged_return attribute #11530
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
9c8223e to
b508730
Compare
|
!bench |
|
Benchmark results for b508730 against 72ddc47 are in! @hargoniX |
|
Mathlib CI status (docs):
|
|
Reference manual CI status:
|
b508730 to
41a78a2
Compare
|
!bench |
|
Benchmark results for 41a78a2 against 72ddc47 are in! @hargoniX Minor changes (1)
|
|
Right, I also once thought about how you could optimize with knowing that certain things are scalars and in particular, I thought about the opposite direction: inferring that something must be a scalar because of being a parameter to a function (e.g. the index for unchecked |
|
Yes, that's what TODO 3 is alluding to. I'm pretty sure all of this can be done with a data flow analysis. But regardless of how that analysis will be implemented, we need to store the information that some extern functions return tagged values statically so that's why I started this way. |
41a78a2 to
5258628
Compare
5258628 to
3d91c9c
Compare
This PR introduces the new `tagged_return` attribute. It allows users to mark `extern` declarations to be guaranteed to always return `tagged` return values. Unlike with `object` or `tobject` the compiler does not emit reference counting operations for them. In the future information from this attribute will be used for a more powerful analysis to remove reference counts when possible.
This PR introduces the new
tagged_returnattribute. It allows users to markexterndeclarations to be guaranteed to always returntaggedreturn values. Unlike withobjectortobjectthe compiler does not emit reference counting operations for them. In the future information from this attribute will be used for a more powerful analysis to remove reference counts when possible.