Index: lib/Target/AMDGPU/SIISelLowering.cpp =================================================================== --- lib/Target/AMDGPU/SIISelLowering.cpp +++ lib/Target/AMDGPU/SIISelLowering.cpp @@ -540,7 +540,7 @@ FunctionType *FType = MF.getFunction()->getFunctionType(); SIMachineFunctionInfo *Info = MF.getInfo(); - assert(CallConv == CallingConv::C); + // FIXME: We currently assume all calling conventions are kernels. SmallVector Splits; BitVector Skipped(Ins.size()); Index: test/CodeGen/AMDGPU/calling-conventions.ll =================================================================== --- /dev/null +++ test/CodeGen/AMDGPU/calling-conventions.ll @@ -0,0 +1,11 @@ +; RUN: llc < %s -march=amdgcn -mcpu=SI -verify-machineinstrs | FileCheck --check-prefix=SI --check-prefix=FUNC %s + +; Make sure we don't crash or assert on spir_kernel calling convention. + +; SI: s_endpgm + +define spir_kernel void @kernel(i32 addrspace(1)* %out) { +entry: + store i32 0, i32 addrspace(1)* %out + ret void +}