[llvm] [IR][CodeGen] Specify llvm.gcroot contents are an opaque zero-initialized blob (PR #222333)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 21:54:49 PDT 2026


https://github.com/isuckatcs requested changes to this pull request.

This patch does 4 things if I counted them right.

1.) reverts some parts of the wrong optimization
2.) fixes the logic error in the optimization
3.) treats `memset` as an initializer as well besides `store`
4.) enables non-pointer roots without a metadata

1.) and 2.) should probably be the same commit. I'd prefer to see a full revert, and the logic error fix merged with the optimization. That way the actual optimization is not split into multiple commits, but it is preserved as just one.

3.) and 4.) should both be separate, atomic commits on their own IMO. The issue here is that probably very few people have an understanding of the GC subsystem, so we don't know what these changes might affect. I'd suggest doing an RFC before commiting them.

I think 4.) should definitely not be enabled due to reasons I discussed [here](https://github.com/llvm/llvm-project/pull/222333/changes#r3975551222)  and [here](https://github.com/llvm/llvm-project/pull/222333/changes#r3975650751).

I'm also **very weakly** leaning towards droping 3.) as well. Like if we accept `memset`, why shouldn't we accept manual per-element  initialization as well? What happens if a user memsets a pointer root to a random value? That breaks the invariant that "not-yet used pointer roots are always `null`. We should also investigate if it affects other lowering passes as well.

https://github.com/llvm/llvm-project/pull/222333


More information about the llvm-commits mailing list