[clang] [llvm] [clang][RISCV] Support the Swift calling convention (PR #213448)

Sam Elliott via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 14:52:01 PDT 2026


================
@@ -0,0 +1,118 @@
+; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
+; RUN:   | FileCheck %s --check-prefixes=CHECK,RV32
+; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
+; RUN:   | FileCheck %s --check-prefixes=CHECK,RV64,RV64-SOFT
+; RUN: llc -mtriple=riscv64 -mattr=+d -target-abi=lp64d -verify-machineinstrs \
+; RUN:   < %s | FileCheck %s --check-prefixes=CHECK,RV64,RV64D
+
+; The Swift calling convention returns values directly in up to four
+; registers, twice the limit of the standard convention.
+
+; A four-element aggregate is returned directly in a0-a3.
+; CHECK-LABEL: gen4:
+; CHECK-DAG: mv a1, a0
+; CHECK-DAG: mv a2, a0
+; CHECK-DAG: mv a3, a0
+; CHECK: ret
----------------
lenary wrote:

Can you please use `update_llc_test_checks.py`, even if it produces irrelevant instructions, it's much easier to review and update tests when codegen changes.

https://github.com/llvm/llvm-project/pull/213448


More information about the cfe-commits mailing list