[all-commits] [llvm/llvm-project] be5075: [CUDA] make kernel stub ICF-proof (#90155)

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Wed May 1 07:24:46 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: be5075ab8daf58a0e981e6bda9579a86fba9a748
      https://github.com/llvm/llvm-project/commit/be5075ab8daf58a0e981e6bda9579a86fba9a748
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2024-05-01 (Wed, 01 May 2024)

  Changed paths:
    M clang/lib/CodeGen/CGCUDANV.cpp
    M clang/test/CodeGenCUDA/kernel-stub-name.cu

  Log Message:
  -----------
  [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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list