Jake Hughes via llvm-dev
2019-Jan-28 22:34 UTC
[llvm-dev] Passing on stack pointers to statepoint GC intrinsic
Hi, I'm trying to use the statepoint intrinsic to record roots for garbage collection at safepoints. I'm using the "statepoint-example" GCStrategy and the RewriteStatepointsForGC pass to insert the statepoint relocation sequences at function invocations. My language allows for function locals which could be GC pointers and are represented in the IR with allocas. The RS4GC pass doesn't include these in the gc pointer list. If I've understood the documentation correctly, I need to include these allocas in the gc pointer operand list myself. I'm not sure how to tackle this though. Specifically my questions are: Do I need to include these pointer values in the deopt param list as well? Should I be extending RS4GC to do this myself, or is there builtin functionality somewhere which I am missing? Are there any examples of this being done? The documentation states w.r.t recording on stack regions that "This alternate form is not well execised ... the RS4GC pass does not do anything for allocas today." [1] I infer from this that there must be a preferred way for dealing with on stack regions, if so, what would that be? Thanks very much for your time, Jake [1] https://llvm.org/docs/Statepoints.html#recording-on-stack-regions