julia
1c59231b - opaque_closure: Allow opting out of PartialOpaque (#54734)

Commit
1 year ago
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.
Author
Parents
Loading