Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17000,6 +17000,7 @@ SDValue RISCVTargetLowering::LowerFormalArguments(
report_fatal_error("Unsupported calling convention");
case CallingConv::C:
case CallingConv::Fast:
case CallingConv::SPIR_KERNEL:
break;
case CallingConv::GHC:
if (!Subtarget.hasStdExtFOrZfinx() || !Subtarget.hasStdExtDOrZdinx())
Expand Down
16 changes: 16 additions & 0 deletions llvm/test/CodeGen/RISCV/spir-kernel-cc.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 < %s | FileCheck %s -check-prefix=RV32
; RUN: llc -mtriple=riscv64 < %s | FileCheck %s -check-prefix=RV64

; Check the SPIR_KERNEL call convention works.

define dso_local spir_kernel void @foo() {
; RV32-LABEL: foo:
; RV32: # %bb.0:
; RV32-NEXT: ret
;
; RV64-LABEL: foo:
; RV64: # %bb.0:
; RV64-NEXT: ret
ret void
}