[gollvm] Question related to RewriteStatepointsForGC pass

59 views
Skip to first unread message

Kavindu Gimhan Zoysa

unread,
Jul 20, 2021, 12:46:58 AM7/20/21
to golang-nuts
Hi all,

After running RewriteStatepointsForGC pass in llvm (using opt-11 --rewrite-statepoints-for-gc), we can see live pointers are added to the go.statepoint intrinsic as shown https://llvm.org/docs/Statepoints.html#rewritestatepointsforgc

But for the below example, if I run the command llvm-goc -S -emit-llvm -enable-gc=1, I expect to add live pointers to go.statepoint intrinsic because there are heap references which are roots to GC(new(emp)).

Can you explain to me why live pointers are not available in go.statepoint intrinsic?
Is go-statepoints pass in gollvm different from llvm RS4GC pass?

package main

type emp struct {
name string
}
func main() {
emp1 := new(emp)
emp1.name = "XYZ"
}

Thank you,
Kavindu
Reply all
Reply to author
Forward
0 new messages