Skip to content

Commit 1f46318

Browse files
committed
Merge rules together.
1 parent 66070f4 commit 1f46318

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

llvm/lib/IR/Verifier.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3632,21 +3632,12 @@ void Verifier::visitCallBase(CallBase &Call) {
36323632
Check(Callee->getValueType() == FTy,
36333633
"Intrinsic called with incompatible signature", Call);
36343634

3635-
// Verify if the calling convention of the callee is callable.
3636-
Check(isCallableCC(Call.getCallingConv()),
3637-
"calling convention does not permit calls", Call);
3638-
36393635
// Find the actual CC of the callee from the Module.
36403636
CallingConv::ID CalleeCC = Call.getParent()->getParent()->getParent()
36413637
->getFunction(Call.getCalledFunction()->getName())->getCallingConv();
3642-
// Verify that a kernel does not call another kernel.
3643-
if (CalleeCC == CallingConv::AMDGPU_KERNEL ||
3644-
CalleeCC == CallingConv::SPIR_KERNEL) {
3645-
CallingConv::ID CallerCC = Call.getParent()->getParent()->getCallingConv();
3646-
Check(CallerCC != CallingConv::AMDGPU_KERNEL &&
3647-
CallerCC != CallingConv::SPIR_KERNEL,
3648-
"a kernel may not call a kernel", Call.getParent()->getParent());
3649-
}
3638+
// Verify if the calling convention of the callee is callable.
3639+
Check(isCallableCC(CalleeCC),
3640+
"calling convention does not permit calls", Call);
36503641

36513642
// Disallow passing/returning values with alignment higher than we can
36523643
// represent.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
1+
; RUN: not llvm-as %s -disable-output 2>&1 | FileCheck %s
22

33
define amdgpu_kernel void @kernel(ptr addrspace(1) %out, i32 %n) {
44
entry:
5-
; CHECK: a kernel may not call a kernel
6-
; CHECK-NEXT: ptr @kernel
5+
; CHECK: calling convention does not permit calls
6+
; CHECK-NEXT: call void @kernel(ptr addrspace(1) %out, i32 %n)
77
call void @kernel(ptr addrspace(1) %out, i32 %n)
88
ret void
99
}

0 commit comments

Comments
 (0)