[NVPTX] Fix poorly designed assertion introduced in D120129
NVPTXTargetLowering::getFunctionParamOptimizedAlign, which was introduces in D120129, contained a poorly designed assertion checking that a function with internal or private linkage is not a kernel. It relied on invariants that were not actually guaranteed, and that resulted in compiler crash with some CUDA versions (see discussion with @jdoerfert in D120129). This patch changes that assertion and makes it use isKernelFunction which is designed exactly for such checks. This patch also includes a test with IR that caused compiler crash before. Differential Revision: https://reviews.llvm.org/D122562
Loading
Please register or sign in to comment