You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
opaque_closure: Allow opting out of PartialOpaque (#54734)
`PartialOpaque` is a powerful mechanism to recover some amount of
identity from opaque closure for inlining and other optimizations.
However, there are two downsides:
1. It causes additional inference work, which is unnecessary if you
already know that you don't want the identity-based optimization.
2. We (currently) disallow :new_opaque_closure in code returned from
generated functions, because we cannot ensure that the identity of any
resulting PartialOpaque will be stable. This somewhat defeats the
purpose of having the opaque closure be, well, opaque.
This PR adds an additional argument to `new_opaque_closure` that decides
whether or not inference is allowed to form `PartialOpaque` for this
`:new_opaque_closure`. If not, it is also permitted to run during
precompile.
0 commit comments