Skip to content

Pass Julia's allocation-zeroing bundles through to shadow allocations - #3632

Closed
oscardssmith wants to merge 1 commit into
EnzymeAD:mainfrom
oscardssmith:os/julia-alloc-init-bundles
Closed

oscardssmith wants to merge 1 commit into
EnzymeAD:mainfrom
oscardssmith:os/julia-alloc-init-bundles

Conversation

@oscardssmith

Copy link
Copy Markdown
Contributor

Julia 1.14 attaches julia.gc_alloc_ptr_offsets, julia.gc_alloc_zeroinit and julia.gc_alloc_zeroinit_indirect operand bundles to its allocations, asking its late GC lowering to null the pointer fields (or zero a region) right after allocation. getInvertedBundles and the bundle use check hit unreachable on these unknown tags. Their operands are primal offsets and sizes that a shadow allocation of the same type shares, so copy them like gc-transition.

(not sufficient, but necessary to get Enzyme working on julia 1.14)
Written by opus 5.5

Julia 1.14 attaches `julia.gc_alloc_ptr_offsets`, `julia.gc_alloc_zeroinit`
and `julia.gc_alloc_zeroinit_indirect` operand bundles to its allocations,
asking its late GC lowering to null the pointer fields (or zero a region)
right after allocation. getInvertedBundles and the bundle use check hit
`unreachable` on these unknown tags. Their operands are primal offsets and
sizes that a shadow allocation of the same type shares, so copy them like
`gc-transition`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@oscardssmith
oscardssmith requested a review from a team November 5, 2026 15:41

@wsmoses wsmoses left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you also inform enzyme analyses that this means the data has pointers zerod (and thus enzyme.jl need not store root zeros)

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.

3 participants