[llvm] r249468 - AMDGPU/SI: Remove calling convention assertion from LowerFormalArguments()
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 6 14:16:34 PDT 2015
Author: tstellar
Date: Tue Oct 6 16:16:34 2015
New Revision: 249468
URL: http://llvm.org/viewvc/llvm-project?rev=249468&view=rev
Log:
AMDGPU/SI: Remove calling convention assertion from LowerFormalArguments()
Summary:
We currently ignore the calling convention, so there is no real reason to
assert on the calling convention of functions.
Reviewers: arsenm
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D13367
Added:
llvm/trunk/test/CodeGen/AMDGPU/calling-conventions.ll
Modified:
llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp?rev=249468&r1=249467&r2=249468&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp Tue Oct 6 16:16:34 2015
@@ -510,7 +510,7 @@ SDValue SITargetLowering::LowerFormalArg
FunctionType *FType = MF.getFunction()->getFunctionType();
SIMachineFunctionInfo *Info = MF.getInfo<SIMachineFunctionInfo>();
- assert(CallConv == CallingConv::C);
+ // FIXME: We currently assume all calling conventions are kernels.
SmallVector<ISD::InputArg, 16> Splits;
BitVector Skipped(Ins.size());
Added: llvm/trunk/test/CodeGen/AMDGPU/calling-conventions.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/calling-conventions.ll?rev=249468&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/calling-conventions.ll (added)
+++ llvm/trunk/test/CodeGen/AMDGPU/calling-conventions.ll Tue Oct 6 16:16:34 2015
@@ -0,0 +1,20 @@
+; RUN: llc < %s -march=amdgcn -mcpu=SI -verify-machineinstrs | FileCheck --check-prefix=SI %s
+
+; Make sure we don't crash or assert on spir_kernel calling convention.
+
+; SI-LABEL: {{^}}kernel:
+; SI: s_endpgm
+define spir_kernel void @kernel(i32 addrspace(1)* %out) {
+entry:
+ store i32 0, i32 addrspace(1)* %out
+ ret void
+}
+
+; FIXME: This is treated like a kernel
+; SI-LABEL: {{^}}func:
+; SI: s_endpgm
+define spir_func void @func(i32 addrspace(1)* %out) {
+entry:
+ store i32 0, i32 addrspace(1)* %out
+ ret void
+}
More information about the llvm-commits
mailing list