Skip to content

Commit 0837100

Browse files
committed
[RISCV] RISCV vector calling convention (1/2)
This is the vector calling convention based on https://github.com/riscv-non-isa/riscv-elf-psabi-doc, the idea is to split between "scalar" callee-saved registers and "vector" callee-saved registers. "scalar" ones remain the original strategy, however, "vector" ones are handled together with RVV objects. The stack layout would be: |--------------------------| <-- FP | callee-allocated save | | area for register varargs| |--------------------------| | callee-saved registers | <-- scalar callee-saved | (scalar) | |--------------------------| | RVV alignment padding | |--------------------------| | callee-saved registers | <-- vector callee-saved | (vector) | |--------------------------| | RVV objects | |--------------------------| | padding before RVV | |--------------------------| | scalar local variables | |--------------------------| <-- BP | variable size objects | |--------------------------| <-- SP Note: This patch doesn't contain "tuple" type, e.g. vint32m1x2. It will be handled in https://github.com/riscv-non-isa/riscv-elf-psabi-doc (2/2). Differential Revision: https://reviews.llvm.org/D154576
1 parent 9f84594 commit 0837100

29 files changed

+409
-50
lines changed

clang/include/clang-c/Index.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2991,6 +2991,7 @@ enum CXCallingConv {
29912991
CXCallingConv_AArch64SVEPCS = 18,
29922992
CXCallingConv_M68kRTD = 19,
29932993
CXCallingConv_PreserveNone = 20,
2994+
CXCallingConv_RISCVVectorCall = 21,
29942995

29952996
CXCallingConv_Invalid = 100,
29962997
CXCallingConv_Unexposed = 200

clang/include/clang/Basic/Attr.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3011,6 +3011,13 @@ def PreserveNone : DeclOrTypeAttr, TargetSpecificAttr<TargetAnyX86> {
30113011
let Documentation = [PreserveNoneDocs];
30123012
}
30133013

3014+
def RISCVVectorCC: DeclOrTypeAttr, TargetSpecificAttr<TargetRISCV> {
3015+
let Spellings = [CXX11<"riscv", "vector_cc">,
3016+
C23<"riscv", "vector_cc">,
3017+
Clang<"riscv_vector_cc">];
3018+
let Documentation = [RISCVVectorCCDocs];
3019+
}
3020+
30143021
def Target : InheritableAttr {
30153022
let Spellings = [GCC<"target">];
30163023
let Args = [StringArgument<"featuresStr">];

clang/include/clang/Basic/AttrDocs.td

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5494,6 +5494,17 @@ for clang builtin functions.
54945494
}];
54955495
}
54965496

5497+
def RISCVVectorCCDocs : Documentation {
5498+
let Category = DocCatCallingConvs;
5499+
let Heading = "riscv::vector_cc, riscv_vector_cc, clang::riscv_vector_cc";
5500+
let Content = [{
5501+
The ``riscv_vector_cc`` attribute can be applied to a function. It preserves 15
5502+
registers namely, v1-v7 and v24-v31 as callee-saved. Callers thus don't need
5503+
to save these registers before function calls, and callees only need to save
5504+
them if they use them.
5505+
}];
5506+
}
5507+
54975508
def PreferredNameDocs : Documentation {
54985509
let Category = DocCatDecl;
54995510
let Content = [{

clang/include/clang/Basic/Specifiers.h

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -273,29 +273,30 @@ namespace clang {
273273

274274
/// CallingConv - Specifies the calling convention that a function uses.
275275
enum CallingConv {
276-
CC_C, // __attribute__((cdecl))
277-
CC_X86StdCall, // __attribute__((stdcall))
278-
CC_X86FastCall, // __attribute__((fastcall))
279-
CC_X86ThisCall, // __attribute__((thiscall))
280-
CC_X86VectorCall, // __attribute__((vectorcall))
281-
CC_X86Pascal, // __attribute__((pascal))
282-
CC_Win64, // __attribute__((ms_abi))
283-
CC_X86_64SysV, // __attribute__((sysv_abi))
284-
CC_X86RegCall, // __attribute__((regcall))
285-
CC_AAPCS, // __attribute__((pcs("aapcs")))
286-
CC_AAPCS_VFP, // __attribute__((pcs("aapcs-vfp")))
287-
CC_IntelOclBicc, // __attribute__((intel_ocl_bicc))
288-
CC_SpirFunction, // default for OpenCL functions on SPIR target
289-
CC_OpenCLKernel, // inferred for OpenCL kernels
290-
CC_Swift, // __attribute__((swiftcall))
276+
CC_C, // __attribute__((cdecl))
277+
CC_X86StdCall, // __attribute__((stdcall))
278+
CC_X86FastCall, // __attribute__((fastcall))
279+
CC_X86ThisCall, // __attribute__((thiscall))
280+
CC_X86VectorCall, // __attribute__((vectorcall))
281+
CC_X86Pascal, // __attribute__((pascal))
282+
CC_Win64, // __attribute__((ms_abi))
283+
CC_X86_64SysV, // __attribute__((sysv_abi))
284+
CC_X86RegCall, // __attribute__((regcall))
285+
CC_AAPCS, // __attribute__((pcs("aapcs")))
286+
CC_AAPCS_VFP, // __attribute__((pcs("aapcs-vfp")))
287+
CC_IntelOclBicc, // __attribute__((intel_ocl_bicc))
288+
CC_SpirFunction, // default for OpenCL functions on SPIR target
289+
CC_OpenCLKernel, // inferred for OpenCL kernels
290+
CC_Swift, // __attribute__((swiftcall))
291291
CC_SwiftAsync, // __attribute__((swiftasynccall))
292-
CC_PreserveMost, // __attribute__((preserve_most))
293-
CC_PreserveAll, // __attribute__((preserve_all))
292+
CC_PreserveMost, // __attribute__((preserve_most))
293+
CC_PreserveAll, // __attribute__((preserve_all))
294294
CC_AArch64VectorCall, // __attribute__((aarch64_vector_pcs))
295-
CC_AArch64SVEPCS, // __attribute__((aarch64_sve_pcs))
296-
CC_AMDGPUKernelCall, // __attribute__((amdgpu_kernel))
297-
CC_M68kRTD, // __attribute__((m68k_rtd))
298-
CC_PreserveNone, // __attribute__((preserve_none))
295+
CC_AArch64SVEPCS, // __attribute__((aarch64_sve_pcs))
296+
CC_AMDGPUKernelCall, // __attribute__((amdgpu_kernel))
297+
CC_M68kRTD, // __attribute__((m68k_rtd))
298+
CC_PreserveNone, // __attribute__((preserve_none))
299+
CC_RISCVVectorCall, // __attribute__((riscv_vector_cc))
299300
};
300301

301302
/// Checks whether the given calling convention supports variadic

clang/lib/AST/ItaniumMangle.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3445,6 +3445,7 @@ StringRef CXXNameMangler::getCallingConvQualifierName(CallingConv CC) {
34453445
case CC_PreserveAll:
34463446
case CC_M68kRTD:
34473447
case CC_PreserveNone:
3448+
case CC_RISCVVectorCall:
34483449
// FIXME: we should be mangling all of the above.
34493450
return "";
34503451

clang/lib/AST/Type.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3484,6 +3484,9 @@ StringRef FunctionType::getNameForCallConv(CallingConv CC) {
34843484
case CC_PreserveAll: return "preserve_all";
34853485
case CC_M68kRTD: return "m68k_rtd";
34863486
case CC_PreserveNone: return "preserve_none";
3487+
// clang-format off
3488+
case CC_RISCVVectorCall: return "riscv_vector_cc";
3489+
// clang-format on
34873490
}
34883491

34893492
llvm_unreachable("Invalid calling convention.");
@@ -4074,6 +4077,7 @@ bool AttributedType::isCallingConv() const {
40744077
case attr::PreserveAll:
40754078
case attr::M68kRTD:
40764079
case attr::PreserveNone:
4080+
case attr::RISCVVectorCC:
40774081
return true;
40784082
}
40794083
llvm_unreachable("invalid attr kind");

clang/lib/AST/TypePrinter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,9 @@ void TypePrinter::printFunctionAfter(const FunctionType::ExtInfo &Info,
10711071
case CC_PreserveNone:
10721072
OS << " __attribute__((preserve_none))";
10731073
break;
1074+
case CC_RISCVVectorCall:
1075+
OS << "__attribute__((riscv_vector_cc))";
1076+
break;
10741077
}
10751078
}
10761079

@@ -1960,6 +1963,9 @@ void TypePrinter::printAttributedAfter(const AttributedType *T,
19601963
case attr::PreserveNone:
19611964
OS << "preserve_none";
19621965
break;
1966+
case attr::RISCVVectorCC:
1967+
OS << "riscv_vector_cc";
1968+
break;
19631969
case attr::NoDeref:
19641970
OS << "noderef";
19651971
break;

clang/lib/Basic/Targets/RISCV.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,3 +467,14 @@ ParsedTargetAttr RISCVTargetInfo::parseTargetAttr(StringRef Features) const {
467467
}
468468
return Ret;
469469
}
470+
471+
TargetInfo::CallingConvCheckResult
472+
RISCVTargetInfo::checkCallingConvention(CallingConv CC) const {
473+
switch (CC) {
474+
default:
475+
return CCCR_Warning;
476+
case CC_C:
477+
case CC_RISCVVectorCall:
478+
return CCCR_OK;
479+
}
480+
}

clang/lib/Basic/Targets/RISCV.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ class RISCVTargetInfo : public TargetInfo {
110110

111111
bool hasBFloat16Type() const override { return true; }
112112

113+
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override;
114+
113115
bool useFP16ConversionIntrinsics() const override {
114116
return false;
115117
}

clang/lib/CodeGen/CGCall.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ unsigned CodeGenTypes::ClangCallConvToLLVMCallConv(CallingConv CC) {
7474
case CC_SwiftAsync: return llvm::CallingConv::SwiftTail;
7575
case CC_M68kRTD: return llvm::CallingConv::M68k_RTD;
7676
case CC_PreserveNone: return llvm::CallingConv::PreserveNone;
77+
// clang-format off
78+
case CC_RISCVVectorCall: return llvm::CallingConv::RISCV_VectorCall;
79+
// clang-format on
7780
}
7881
}
7982

@@ -260,6 +263,9 @@ static CallingConv getCallingConventionForDecl(const ObjCMethodDecl *D,
260263
if (D->hasAttr<PreserveNoneAttr>())
261264
return CC_PreserveNone;
262265

266+
if (D->hasAttr<RISCVVectorCCAttr>())
267+
return CC_RISCVVectorCall;
268+
263269
return CC_C;
264270
}
265271

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,8 @@ static unsigned getDwarfCC(CallingConv CC) {
14521452
return llvm::dwarf::DW_CC_LLVM_M68kRTD;
14531453
case CC_PreserveNone:
14541454
return llvm::dwarf::DW_CC_LLVM_PreserveNone;
1455+
case CC_RISCVVectorCall:
1456+
return llvm::dwarf::DW_CC_LLVM_RISCVVectorCall;
14551457
}
14561458
return 0;
14571459
}

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5271,6 +5271,9 @@ static void handleCallConvAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
52715271
case ParsedAttr::AT_PreserveNone:
52725272
D->addAttr(::new (S.Context) PreserveNoneAttr(S.Context, AL));
52735273
return;
5274+
case ParsedAttr::AT_RISCVVectorCC:
5275+
D->addAttr(::new (S.Context) RISCVVectorCCAttr(S.Context, AL));
5276+
return;
52745277
default:
52755278
llvm_unreachable("unexpected attribute kind");
52765279
}
@@ -5475,6 +5478,9 @@ bool Sema::CheckCallingConvAttr(const ParsedAttr &Attrs, CallingConv &CC,
54755478
case ParsedAttr::AT_PreserveNone:
54765479
CC = CC_PreserveNone;
54775480
break;
5481+
case ParsedAttr::AT_RISCVVectorCC:
5482+
CC = CC_RISCVVectorCall;
5483+
break;
54785484
default: llvm_unreachable("unexpected attribute kind");
54795485
}
54805486

@@ -9637,6 +9643,7 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL,
96379643
case ParsedAttr::AT_AMDGPUKernelCall:
96389644
case ParsedAttr::AT_M68kRTD:
96399645
case ParsedAttr::AT_PreserveNone:
9646+
case ParsedAttr::AT_RISCVVectorCC:
96409647
handleCallConvAttr(S, D, AL);
96419648
break;
96429649
case ParsedAttr::AT_Suppress:

clang/lib/Sema/SemaType.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ static void diagnoseBadTypeAttribute(Sema &S, const ParsedAttr &attr,
138138
case ParsedAttr::AT_PreserveMost: \
139139
case ParsedAttr::AT_PreserveAll: \
140140
case ParsedAttr::AT_M68kRTD: \
141-
case ParsedAttr::AT_PreserveNone
141+
case ParsedAttr::AT_PreserveNone: \
142+
case ParsedAttr::AT_RISCVVectorCC
142143

143144
// Function type attributes.
144145
#define FUNCTION_TYPE_ATTRS_CASELIST \
@@ -7939,6 +7940,8 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) {
79397940
return createSimpleAttr<M68kRTDAttr>(Ctx, Attr);
79407941
case ParsedAttr::AT_PreserveNone:
79417942
return createSimpleAttr<PreserveNoneAttr>(Ctx, Attr);
7943+
case ParsedAttr::AT_RISCVVectorCC:
7944+
return createSimpleAttr<RISCVVectorCCAttr>(Ctx, Attr);
79427945
}
79437946
llvm_unreachable("unexpected attribute kind!");
79447947
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// REQUIRES: riscv-registered-target
2+
// RUN: %clang_cc1 -triple riscv64 -target-feature +v \
3+
// RUN: -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-LLVM %s
4+
// RUN: %clang_cc1 -std=c23 -triple riscv64 -target-feature +v \
5+
// RUN: -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-LLVM %s
6+
7+
#include <riscv_vector.h>
8+
9+
// CHECK-LLVM: call riscv_vector_cc <vscale x 2 x i32> @bar
10+
vint32m1_t __attribute__((riscv_vector_cc)) bar(vint32m1_t input);
11+
vint32m1_t test_vector_cc_attr(vint32m1_t input, int32_t *base, size_t vl) {
12+
vint32m1_t val = __riscv_vle32_v_i32m1(base, vl);
13+
vint32m1_t ret = bar(input);
14+
__riscv_vse32_v_i32m1(base, val, vl);
15+
return ret;
16+
}
17+
18+
// CHECK-LLVM: call riscv_vector_cc <vscale x 2 x i32> @bar
19+
[[riscv::vector_cc]] vint32m1_t bar(vint32m1_t input);
20+
vint32m1_t test_vector_cc_attr2(vint32m1_t input, int32_t *base, size_t vl) {
21+
vint32m1_t val = __riscv_vle32_v_i32m1(base, vl);
22+
vint32m1_t ret = bar(input);
23+
__riscv_vse32_v_i32m1(base, val, vl);
24+
return ret;
25+
}
26+
27+
// CHECK-LLVM: call <vscale x 2 x i32> @baz
28+
vint32m1_t baz(vint32m1_t input);
29+
vint32m1_t test_no_vector_cc_attr(vint32m1_t input, int32_t *base, size_t vl) {
30+
vint32m1_t val = __riscv_vle32_v_i32m1(base, vl);
31+
vint32m1_t ret = baz(input);
32+
__riscv_vse32_v_i32m1(base, val, vl);
33+
return ret;
34+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// REQUIRES: riscv-registered-target
2+
// RUN: %clang_cc1 -std=c++11 -triple riscv64 -target-feature +v \
3+
// RUN: -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-LLVM %s
4+
5+
#include <riscv_vector.h>
6+
7+
// CHECK-LLVM: call riscv_vector_cc <vscale x 2 x i32> @_Z3baru15__rvv_int32m1_t
8+
vint32m1_t __attribute__((riscv_vector_cc)) bar(vint32m1_t input);
9+
vint32m1_t test_vector_cc_attr(vint32m1_t input, int32_t *base, size_t vl) {
10+
vint32m1_t val = __riscv_vle32_v_i32m1(base, vl);
11+
vint32m1_t ret = bar(input);
12+
__riscv_vse32_v_i32m1(base, val, vl);
13+
return ret;
14+
}
15+
16+
// CHECK-LLVM: call riscv_vector_cc <vscale x 2 x i32> @_Z3baru15__rvv_int32m1_t
17+
[[riscv::vector_cc]] vint32m1_t bar(vint32m1_t input);
18+
vint32m1_t test_vector_cc_attr2(vint32m1_t input, int32_t *base, size_t vl) {
19+
vint32m1_t val = __riscv_vle32_v_i32m1(base, vl);
20+
vint32m1_t ret = bar(input);
21+
__riscv_vse32_v_i32m1(base, val, vl);
22+
return ret;
23+
}
24+
25+
// CHECK-LLVM: call <vscale x 2 x i32> @_Z3bazu15__rvv_int32m1_t
26+
vint32m1_t baz(vint32m1_t input);
27+
vint32m1_t test_no_vector_cc_attr(vint32m1_t input, int32_t *base, size_t vl) {
28+
vint32m1_t val = __riscv_vle32_v_i32m1(base, vl);
29+
vint32m1_t ret = baz(input);
30+
__riscv_vse32_v_i32m1(base, val, vl);
31+
return ret;
32+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// RUN: %clang_cc1 %s -std=c23 -triple riscv64 -target-feature +v -verify
2+
3+
__attribute__((riscv_vector_cc)) int var; // expected-warning {{'riscv_vector_cc' only applies to function types; type here is 'int'}}
4+
5+
__attribute__((riscv_vector_cc)) void func();
6+
__attribute__((riscv_vector_cc(1))) void func_invalid(); // expected-error {{'riscv_vector_cc' attribute takes no arguments}}
7+
8+
void test_no_attribute(int); // expected-note {{previous declaration is here}}
9+
void __attribute__((riscv_vector_cc)) test_no_attribute(int x) { } // expected-error {{function declared 'riscv_vector_cc' here was previously declared without calling convention}}
10+
11+
[[riscv::vector_cc]] int var2; // expected-warning {{'vector_cc' only applies to function types; type here is 'int'}}
12+
13+
[[riscv::vector_cc]] void func2();
14+
[[riscv::vector_cc(1)]] void func_invalid2(); // expected-error {{'vector_cc' attribute takes no arguments}}
15+
16+
void test_no_attribute2(int); // expected-note {{previous declaration is here}}
17+
[[riscv::vector_cc]] void test_no_attribute2(int x) { } // expected-error {{function declared 'riscv_vector_cc' here was previously declared without calling convention}}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// RUN: %clang_cc1 %s -triple riscv64 -target-feature +v -verify
2+
3+
__attribute__((riscv_vector_cc)) int var; // expected-warning {{'riscv_vector_cc' only applies to function types; type here is 'int'}}
4+
5+
__attribute__((riscv_vector_cc)) void func();
6+
__attribute__((riscv_vector_cc(1))) void func_invalid(); // expected-error {{'riscv_vector_cc' attribute takes no arguments}}
7+
8+
void test_no_attribute(int); // expected-note {{previous declaration is here}}
9+
void __attribute__((riscv_vector_cc)) test_no_attribute(int x) { } // expected-error {{function declared 'riscv_vector_cc' here was previously declared without calling convention}}
10+
11+
class test_cc {
12+
__attribute__((riscv_vector_cc)) void member_func();
13+
};
14+
15+
void test_lambda() {
16+
__attribute__((riscv_vector_cc)) auto lambda = []() { // expected-warning {{'riscv_vector_cc' only applies to function types; type here is 'auto'}}
17+
};
18+
}
19+
20+
[[riscv::vector_cc]] int var2; // expected-warning {{'vector_cc' only applies to function types; type here is 'int'}}
21+
22+
[[riscv::vector_cc]] void func2();
23+
[[riscv::vector_cc(1)]] void func_invalid2(); // expected-error {{'vector_cc' attribute takes no arguments}}
24+
25+
void test_no_attribute2(int); // expected-note {{previous declaration is here}}
26+
[[riscv::vector_cc]] void test_no_attribute2(int x) { } // expected-error {{function declared 'riscv_vector_cc' here was previously declared without calling convention}}
27+
28+
class test_cc2 {
29+
[[riscv::vector_cc]] void member_func();
30+
};
31+
32+
void test_lambda2() {
33+
[[riscv::vector_cc]] auto lambda = []() { // expected-warning {{'vector_cc' only applies to function types; type here is 'auto'}}
34+
};
35+
}

clang/tools/libclang/CXType.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,7 @@ CXCallingConv clang_getFunctionTypeCallingConv(CXType X) {
680680
TCALLINGCONV(PreserveAll);
681681
TCALLINGCONV(M68kRTD);
682682
TCALLINGCONV(PreserveNone);
683+
TCALLINGCONV(RISCVVectorCall);
683684
case CC_SpirFunction: return CXCallingConv_Unexposed;
684685
case CC_AMDGPUKernelCall: return CXCallingConv_Unexposed;
685686
case CC_OpenCLKernel: return CXCallingConv_Unexposed;

llvm/include/llvm/AsmParser/LLToken.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ enum Kind {
181181
kw_tailcc,
182182
kw_m68k_rtdcc,
183183
kw_graalcc,
184+
kw_riscv_vector_cc,
184185

185186
// Attributes:
186187
kw_attributes,

llvm/include/llvm/BinaryFormat/Dwarf.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,7 @@ HANDLE_DW_CC(0xca, LLVM_PreserveAll)
10401040
HANDLE_DW_CC(0xcb, LLVM_X86RegCall)
10411041
HANDLE_DW_CC(0xcc, LLVM_M68kRTD)
10421042
HANDLE_DW_CC(0xcd, LLVM_PreserveNone)
1043+
HANDLE_DW_CC(0xce, LLVM_RISCVVectorCall)
10431044
// From GCC source code (include/dwarf2.h): This DW_CC_ value is not currently
10441045
// generated by any toolchain. It is used internally to GDB to indicate OpenCL
10451046
// C functions that have been compiled with the IBM XL C for OpenCL compiler and

llvm/include/llvm/IR/CallingConv.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ namespace CallingConv {
264264
/// except that the first parameter is mapped to x9.
265265
ARM64EC_Thunk_Native = 109,
266266

267+
/// Calling convention used for RISC-V V-extension.
268+
RISCV_VectorCall = 110,
269+
267270
/// The highest possible ID. Must be some 2^k - 1.
268271
MaxID = 1023
269272
};

0 commit comments

Comments
 (0)