[llvm] IR/Verifier: Do not allow kernel to kernel calls. (PR #144445)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 17 10:23:18 PDT 2025


================
@@ -3632,8 +3632,11 @@ void Verifier::visitCallBase(CallBase &Call) {
     Check(Callee->getValueType() == FTy,
           "Intrinsic called with incompatible signature", Call);
 
+  // Find the actual CC of the callee from the Module.
+  CallingConv::ID CalleeCC = Call.getParent()->getParent()->getParent()
+      ->getFunction(Call.getCalledFunction()->getName())->getCallingConv();
----------------
jofrn wrote:

Right, it is, but we can have a call of the function without its CC specified. If its definition has a kernel CC, then the callsite may be treated as requiring the definition as well. If the Verifier checks like this, then we will not error out in a location that requires the callsite to have the CC at its definition; we will error in the Verifier instead.

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


More information about the llvm-commits mailing list