llvm-project
b4a49883 - [HIP] Fix ubsan function checks applied to kernel functions (#188872)

Commit
13 hours ago
[HIP] Fix ubsan function checks applied to kernel functions (#188872) Summary: The 'function' check requires inserting eight bytes of magic before each function. The HIP runtime expects and enforces 256 byte alignment. When the instrumentation inserts the eight bytes this is done after the alignment, which means that the HIP runtime then points the PC to an invalid instruction by truncating the address to 256 byte alignment. The OpenMP runtime doesn't do this. The purpose of this function is to handle indirect calls, and it's impossible to indirectly call a kernel anyway, so we should just suppress this in this case. The only other solution would be to add the alignment back before we emit the label, but that would be meaningless because it'd just replace the magic bytes with zeroes.
Author
Parents
Loading