-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
A few cleanup/optimizations related to tag handling in codegen #24283
Conversation
|
5dfdf48
to
06002c9
Compare
I can't find LLVM doc for how to deal with this but the solution seems wrong since it is explicitly documented that |
170bd44
to
e790bd4
Compare
99f48e9
to
eef4cff
Compare
... I should stop adding more stuff to this PR.... This is now ~5 PR's squashed into one.... |
357827d
to
7b8a9b9
Compare
Review? Should I merge this as is or should I split things out a little? |
c1da47a
to
aa8adc8
Compare
* Create `julia.typeof` and `julia.write_barrier` intrinsics So that tag access is easier for the llvm passes to handle. This also completely hides the tag access from LLVM before lowering of these intrinsics which makes it possible to mark the write barrier as `inaccessiblememonly` and enable store to load forwarding on mutable types. * Mark `jl_gc_queue_root` as `inaccessiblemem_or_argmemonly`. Should also have a positive impact on LLVM memory access optimizations. * In non-imaging mode, use the pointer literals directly for union type. * Remove old code that check whether the child is NULL before running the write barrier This is not needed anymore. * Mark functions returning julia object as `nonnull` return. This can avoid `NULL` check together with the improved store to load forwarding. * Remove `jlnewbits_func` which is not used in codegen anymore. * Fix `LateLowerGCFrame` initialization `runOnFunction` shouldn't modify the `Module`. * Add more `dereferencable` attributes and explicitly specify `nonnull` since it is not implied by `dereferencable` for non default addrspace. Also add range metadata on the tag load. The change should also make it easier to do more allocation optmization in LLVM for objects with object reference as fields.
aa8adc8
to
956f45b
Compare
Without corruption that should only cause segfault if the |
Previously the calls to this function were guarded by |
Create
julia.typeof
andjulia.write_barrier
intrinsicsSo that tag access is easier for the llvm passes to handle.
This also completely hides the tag access from LLVM before lowering of these intrinsics
which makes it possible to mark the write barrier as
inaccessiblememonly
and enablestore to load forwarding on mutable types.
Mark
jl_gc_queue_root
asinaccessiblemem_or_argmemonly
.Should also have a positive impact on LLVM memory access optimizations.
In non-imaging mode, use the pointer literals directly for union type.
Remove old code that check whether the child is NULL before running the write barrier
This is not needed anymore.
Mark functions returning julia object as
nonnull
return.This can avoid
NULL
check together with the improved store to load forwarding.Remove
jlnewbits_func
which is not used in codegen anymore.Fix
LateLowerGCFrame
initializationrunOnFunction
shouldn't modify theModule
.The change should also make it easier to do more allocation optmization in LLVM for objects
with object reference as fields.