Unverified Commit be5075ab authored by Yaxun (Sam) Liu's avatar Yaxun (Sam) Liu Committed by GitHub
Browse files

[CUDA] make kernel stub ICF-proof (#90155)

MSVC linker merges functions having comdat which have identical set of
instructions. CUDA uses kernel stub function as key to look up kernels
in device executables. If kernel stub function for different kernels are
merged by ICF, incorrect kernels will be launched.

To prevent ICF from merging kernel stub functions, an unique global
variable is created for each kernel stub function having comdat and a
store is added to the kernel stub function. This makes the set of
instructions in each kernel function unique.

Fixes: https://github.com/llvm/llvm-project/issues/88883
parent f07a2edc
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment