[clang] [compiler-rt] [llvm] [XRay][RISCV] RISCV support for XRay (PR #117368)

Sam Elliott via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 4 03:54:22 PST 2024


================
@@ -0,0 +1,87 @@
+//===-- xray_trampoline_riscv32.s ----------------------------------*- ASM -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of XRay, a dynamic runtime instrumentation system.
+//
+// This implements the riscv32-specific assembler for the trampolines.
+//
+//===----------------------------------------------------------------------===//
+
+.macro SAVE_ARG_REGISTERS
+	// Push argument registers to stack
+	addi	sp, sp, -112
+	.cfi_def_cfa_offset 112
+	sw	ra, 108(sp)
+	.cfi_offset ra, -4
+	sw	a7, 104(sp)
+	sw	a6, 100(sp)
+	sw	a5, 96(sp)
+	sw	a4, 92(sp)
+	sw	a3, 88(sp)
+	sw	a2, 84(sp)
+	sw	a1, 80(sp)
+	sw	a0, 76(sp)
+	fsd	fa7, 64(sp)
+	fsd	fa6, 56(sp)
+	fsd	fa5, 48(sp)
+	fsd	fa4, 40(sp)
+	fsd	fa3, 32(sp)
+	fsd	fa2, 24(sp)
+	fsd	fa1, 16(sp)
+	fsd	fa0, 8(sp)
----------------
lenary wrote:

Is there a specific reason why you've given unwind/cfi information for just `ra`, and not these other registers? It's not clear to me whether anyone is expected to unwind through this code.

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


More information about the cfe-commits mailing list