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

WIP: Allow generated functions to return a CodeInstance #56650

Closed
wants to merge 1 commit into from

Commits on Nov 22, 2024

  1. WIP: Allow generated functions to return a CodeInstance

    This PR allows generated functions to return a `CodeInstance` containing
    optimized IR, allowing them to bypass inference and directly adding
    inferred code into the ordinary course of execution. This is an enabling
    capability for various external compiler implementations that may want
    to provide compilation results to the Julia runtime.
    
    As a minimal demonstrator of this capability, this adds a
    Cassette-like `with_new_compiler` higher-order function, which
    will compile/execute its arguments with the currently loaded `Compiler`
    package. Unlike `@activate Compiler[:codegen]`, this change is not
    global and the cache is fully partitioned. This by itself is a very
    useful feature when developing Compiler code to be able to test
    the full end-to-end codegen behavior before the changes are capable
    of fully self-hosting.
    
    A key enabler for this was the recent merging of #54899. This PR
    includes a hacky version of the second TODO left at the end of
    that PR, just to make everthing work end-to-end.
    
    This PR is working end-to-end, but all three parts of it (the CodeInstance
    return from generated functions, the `with_new_compiler` feature,
    and the interpreter integration) need some additional cleanup. This
    PR is mostly intended as a discussion point for what that additional
    work needs to be.
    Keno committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    0d66579 View commit details
    Browse the repository at this point in the history