Skip to content

Commit 654a3a3

Browse files
authored
[OpenCL][RISCV] Support SPIR_KERNEL calling convention (#69282)
X86 supports this calling convention but I don't find any special handling, so I think we can just handle it via CC_RISCV. This should fix #69197.
1 parent 208a6d9 commit 654a3a3

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17004,6 +17004,7 @@ SDValue RISCVTargetLowering::LowerFormalArguments(
1700417004
report_fatal_error("Unsupported calling convention");
1700517005
case CallingConv::C:
1700617006
case CallingConv::Fast:
17007+
case CallingConv::SPIR_KERNEL:
1700717008
break;
1700817009
case CallingConv::GHC:
1700917010
if (!Subtarget.hasStdExtFOrZfinx() || !Subtarget.hasStdExtDOrZdinx())
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; RUN: llc -mtriple=riscv32 < %s | FileCheck %s -check-prefix=RV32
3+
; RUN: llc -mtriple=riscv64 < %s | FileCheck %s -check-prefix=RV64
4+
5+
; Check the SPIR_KERNEL call convention works.
6+
7+
define dso_local spir_kernel void @foo() {
8+
; RV32-LABEL: foo:
9+
; RV32: # %bb.0:
10+
; RV32-NEXT: ret
11+
;
12+
; RV64-LABEL: foo:
13+
; RV64: # %bb.0:
14+
; RV64-NEXT: ret
15+
ret void
16+
}

0 commit comments

Comments
 (0)