[llvm] [AMDGPU][Verifier] Mark calls to entry functions as invalid in the IR verifier (PR #134910)
    Matt Arsenault via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Apr 10 03:08:46 PDT 2025
    
    
  
================
@@ -290,6 +290,26 @@ namespace CallingConv {
 
 } // end namespace CallingConv
 
+/// \return true if the calling convention allows the function to be called
+/// directly or indirectly via a call-like instruction.
+constexpr bool isCallableCC(CallingConv::ID CC) {
+  switch (CC) {
+  case CallingConv::AMDGPU_CS_Chain:
+  case CallingConv::AMDGPU_CS_ChainPreserve:
+  case CallingConv::AMDGPU_CS:
+  case CallingConv::AMDGPU_ES:
+  case CallingConv::AMDGPU_GS:
+  case CallingConv::AMDGPU_HS:
+  case CallingConv::AMDGPU_KERNEL:
+  case CallingConv::AMDGPU_LS:
+  case CallingConv::AMDGPU_PS:
+  case CallingConv::AMDGPU_VS:
+    return false;
----------------
arsenm wrote:
It should not be allowed. Also SPIR_KERNEL actually came from spir classic and SPIR-V just started picking it up. 
https://github.com/llvm/llvm-project/pull/134910
    
    
More information about the llvm-commits
mailing list