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

2024-05-01 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/90155 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-29 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/90155 >From 7a741109a6769e2e91d77a82d9a44c7f9c212c48 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 25 Apr 2024 22:23:26 -0400 Subject: [PATCH] [CUDA] make kernel stub ICF-proof MSVC linker may merge fun

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

2024-04-29 Thread Yaxun Liu via cfe-commits
@@ -424,6 +424,34 @@ void CGNVCUDARuntime::emitDeviceStubBodyNew(CodeGenFunction &CGF, CGM.CreateRuntimeFunction(FTy, LaunchKernelName); CGF.EmitCall(FI, CGCallee::forDirect(cudaLaunchKernelFn), ReturnValueSlot(), LaunchKernelArgs); + + // To prevent CU

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

2024-04-29 Thread Yaxun Liu via cfe-commits
@@ -424,6 +424,34 @@ void CGNVCUDARuntime::emitDeviceStubBodyNew(CodeGenFunction &CGF, CGM.CreateRuntimeFunction(FTy, LaunchKernelName); CGF.EmitCall(FI, CGCallee::forDirect(cudaLaunchKernelFn), ReturnValueSlot(), LaunchKernelArgs); + + // To prevent CU

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

2024-04-29 Thread Yaxun Liu via cfe-commits
@@ -424,6 +424,34 @@ void CGNVCUDARuntime::emitDeviceStubBodyNew(CodeGenFunction &CGF, CGM.CreateRuntimeFunction(FTy, LaunchKernelName); CGF.EmitCall(FI, CGCallee::forDirect(cudaLaunchKernelFn), ReturnValueSlot(), LaunchKernelArgs); + + // To prevent CU

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

2024-04-29 Thread Reid Kleckner via cfe-commits
@@ -424,6 +424,34 @@ void CGNVCUDARuntime::emitDeviceStubBodyNew(CodeGenFunction &CGF, CGM.CreateRuntimeFunction(FTy, LaunchKernelName); CGF.EmitCall(FI, CGCallee::forDirect(cudaLaunchKernelFn), ReturnValueSlot(), LaunchKernelArgs); + + // To prevent CU

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

2024-04-29 Thread Reid Kleckner via cfe-commits
@@ -424,6 +424,34 @@ void CGNVCUDARuntime::emitDeviceStubBodyNew(CodeGenFunction &CGF, CGM.CreateRuntimeFunction(FTy, LaunchKernelName); CGF.EmitCall(FI, CGCallee::forDirect(cudaLaunchKernelFn), ReturnValueSlot(), LaunchKernelArgs); + + // To prevent CU

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

2024-04-29 Thread Reid Kleckner via cfe-commits
@@ -424,6 +424,34 @@ void CGNVCUDARuntime::emitDeviceStubBodyNew(CodeGenFunction &CGF, CGM.CreateRuntimeFunction(FTy, LaunchKernelName); CGF.EmitCall(FI, CGCallee::forDirect(cudaLaunchKernelFn), ReturnValueSlot(), LaunchKernelArgs); + + // To prevent CU

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

2024-04-29 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/90155 >From 112e5eb538d4167a1d7be6c7171df1ca51cb374e Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 25 Apr 2024 22:23:26 -0400 Subject: [PATCH] [CUDA] make kernel stub ICF-proof MSVC linker merges functi

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

2024-04-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Yaxun (Sam) Liu (yxsamliu) Changes 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 di

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

2024-04-25 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/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