[llvm] [AMDGPU][Verifier] Mark calls to entry functions as invalid in the IR verifier (PR #134910)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 14 03:54:48 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;
----------------
MrSidims wrote:

I lean to disagree. SPIR_KERNEL _can_ be included _conditionally_. If triple is `spirv`, then sure, validation rule makes sense. But for `spir` triple it does look like a breaking change, as there is no such restriction in OpenCL or SPIR specification.

https://github.com/llvm/llvm-project/pull/134910


More information about the llvm-commits mailing list