[CUDA] Update cached kernel handle when the function instance changes.
authorArtem Belevich <tra@google.com>
Mon, 20 Mar 2023 18:18:53 +0000 (11:18 -0700)
committerArtem Belevich <tra@google.com>
Tue, 21 Mar 2023 22:36:12 +0000 (15:36 -0700)
commit2aa90da012596712a4166e96d2a40fc90598c7fb
tree0fa60c42170c15927ae5b97bdf2bd7f342bb7124
parentc5f6339c126c2eec43658e0fba05f5f606349d6d
[CUDA] Update cached kernel handle when the function instance changes.

Fixes clang crash caused by a stale function pointer.

The bug has been present for a pretty long time, but we were lucky not to
trigger it until  D140663.

Differential Revision: https://reviews.llvm.org/D146448
clang/lib/CodeGen/CGCUDANV.cpp
clang/test/CodeGenCUDA/bug-kerner-registration-reuse.cu [new file with mode: 0644]