- Under different ABIs, it's obvious that assertion is too strong. Even under the same ABI, once there are unnamed type not required to follow ODR rule, host- and device-side mangling may still get different names. As both the host- and device-side compilation always observe the same AST tree, even with different names, we still could associate the correct pairs, i.e., we don't use (mangled) names to linkage host- and device-side globals. There's no need to have this assertion.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 33014 Build 33013: arc lint + arc unit
Event Timeline
LGTM. It seems no reason to assume the mangled name to be same on host and device side once anonymous types are mangled differently in host and device code. On windows, kernel has totally different names on host and device side without issues.
clang/test/CodeGenCUDA/unnamed-types.cu | ||
---|---|---|
5 | device-side mangled name, notice that $_0 refers to the unnamed closure in f1. | |
24 | the registration of host-side stub function to the device-side function name, which is defined in @0. Notice that the host-side stub function has $_1, which refers to the closure in f1 as there's another closure (host-only) in f0. |
I took this back. I fab a case where anonymous type IDs mismatch between the device-side name between host-compilation and device-compilation.
device-side mangled name, notice that $_0 refers to the unnamed closure in f1.