Remove arraylist_t from external native code APIs. #56693
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GPUCompiler.jl used to rely on calls to the
lookup
function (mapping MIs to CIs) to keep track of MIs used during compilation, which Enzyme.jl then uses for... whatever it does. After #54899, the IR already contains CIs, resulting in this not being reliable anymore, as thelookup
callback isn't invoked for every CI anymore.I noticed that we already had accessor functions for fetching the list of MIs involved in a native compilation,
jl_get_llvm_mis
, however these functions currently usearraylist_t
objects that are not usable to external consumers like GPUCompiler.jl. This PR switches those APIs over to a more traditional C style, passing pointers to the number of elements and the underlying data.I guess it may be better for Enzyme.jl to consume CIs instead of MIs so that we don't need to maintain this mapping, but I focussed first on making the existing logic work again, and generalizing the current APIs doesn't seem to have much of a drawback.