-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
#9267 fixed dropping of kernels by pynvjitlink by adding kernels to the @llvm.used list.
We also add global variables for representing an error handling state:
Lines 219 to 224 in 03f2722
| def define_error_gv(postfix): | |
| name = wrapfn.name + postfix | |
| gv = cgutils.add_global_variable(wrapper_module, ir.IntType(32), | |
| name) | |
| gv.initializer = ir.Constant(gv.type.pointee, None) | |
| return gv |
The variables seem to get optimized away when LTO is used with pynvjitlink, and I suspect they should also be added to the @llvm.used list to prevent them being optimized away - from the perspective of device code, they are only ever written to, so they look un-needed - it's only the host that looks up their values after kernel execution.