Skip to content

Conversation

Keno
Copy link
Member

@Keno Keno commented May 14, 2024

I was playing with generating some code for OpaqueClosures. It's pretty easy to generate IR that will pass the verifier, but cause assertion errors in codegen. This tries to make the experience slightly nicer by turning some of them into proper error messages (thus letting the runtime discover, so that e.g. the code can be inspected at the REPL) rather than assertions.

@Keno Keno force-pushed the kf/malformedir branch from 9e0a822 to 8221b50 Compare May 23, 2024 00:23
I was playing with generating some code for OpaqueClosures. It's
pretty easy to generate IR that will pass the verifier, but cause
assertion errors in codegen. This tries to make the experience
slightly nicer by turning some of them into proper error messages
(thus letting the runtime discover, so that e.g. the code can be
inspected at the REPL) rather than assertions.
@Keno Keno force-pushed the kf/malformedir branch from 8221b50 to 46995e0 Compare May 23, 2024 18:53
@Keno Keno merged commit 1ed6a9f into master May 23, 2024
@Keno Keno deleted the kf/malformedir branch May 23, 2024 20:46
if (source->source) {
mi = jl_specializations_get_linfo(source, sigtype, jl_emptysvec);
} else {
mi = (jl_method_instance_t *)jl_atomic_load_relaxed(&source->specializations);
Copy link
Member

@topolarity topolarity May 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we always know that the method will have a single specialization?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opaque closures made from optimized IR source == NULL have this structure.

lazarusA pushed a commit to lazarusA/julia that referenced this pull request Jul 12, 2024
…uliaLang#54458)

I was playing with generating some code for OpaqueClosures. It's pretty
easy to generate IR that will pass the verifier, but cause assertion
errors in codegen. This tries to make the experience slightly nicer by
turning some of them into proper error messages (thus letting the
runtime discover, so that e.g. the code can be inspected at the REPL)
rather than assertions.
serenity4 added a commit to serenity4/Diffractor.jl that referenced this pull request Feb 21, 2025
Keno pushed a commit to JuliaDiff/Diffractor.jl that referenced this pull request Mar 3, 2025
* Adapt to JuliaLang/julia#56509

* Adapt to JuliaLang/julia#54734

* Use StmtRange explicitly

* Adapt to JuliaLang/julia#57230

* Reuse Cthulhu code structure for Compiler cache/finish overrides

* Adapt to JuliaLang/julia#57475

* Adapt to JuliaLang/julia#55976

* Adapt to JuliaLang/julia#54734

* Use CC instead of .Compiler

* Implement ir.argtypes[1] fix from JuliaLang/julia#54458

* Comment out failing tests

To highlight which are broken, should probably be fixed before merging

* Treat `getproperty(::Module, ::Symbol)` like GlobalRefs

* Uncomment passing tests, explicitly mark others as broken

* Evaluate GlobalRef only if binding is defined

* Use `rrule` for getproperty(::Module, ::Symbol)

* Bump compat bound for StructArrays

* Raise compat bound for Cthulhu

* Revert `isconst` change now that it is fixed

* Adapt to `finishinfer!` signature change

---------

Co-authored-by: Cédric Belmant <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants