[PATCH] D13367: AMDGPU/SI: Remove calling convention assertion from LowerFormalArguments()

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 15:36:18 PDT 2015


tstellarAMD created this revision.
tstellarAMD added a reviewer: arsenm.
tstellarAMD added a subscriber: llvm-commits.
Herald added a subscriber: arsenm.

We currently ignore the calling convention, so there is no real reason to
assert on the calling convention of functions.

http://reviews.llvm.org/D13367

Files:
  lib/Target/AMDGPU/SIISelLowering.cpp
  test/CodeGen/AMDGPU/calling-conventions.ll

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
+}
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<SIMachineFunctionInfo>();
 
-  assert(CallConv == CallingConv::C);
+  // FIXME: We currently assume all calling conventions are kernels.
 
   SmallVector<ISD::InputArg, 16> Splits;
   BitVector Skipped(Ins.size());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13367.36314.patch
Type: text/x-patch
Size: 1062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151001/bbefef51/attachment.bin>


More information about the llvm-commits mailing list