[all-commits] [llvm/llvm-project] 3f46af: [RISCV] Support Push/Pop with Xqci (#134191)
Sam Elliott via All-commits
all-commits at lists.llvm.org
Mon Apr 28 08:13:08 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 3f46af98caa2d0c3b8dcde02f0cc08fde03376c9
https://github.com/llvm/llvm-project/commit/3f46af98caa2d0c3b8dcde02f0cc08fde03376c9
Author: Sam Elliott <quic_aelliott at quicinc.com>
Date: 2025-04-28 (Mon, 28 Apr 2025)
Changed paths:
M llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
M llvm/test/CodeGen/RISCV/qci-interrupt-attr.ll
Log Message:
-----------
[RISCV] Support Push/Pop with Xqci (#134191)
The `qc.c.mienter` and `qc.c.mienter.nest` instructions, broadly only
save the argument and temporary registers. The exceptions are that they
also save `fp` (`s0`) to construct a frame chain from the signal handler
to the frame below, and they also save `ra`. They are designed this way
so that (if needed) push and pop instructions can be used to save the
callee-saved registers.
This patch implements this optimisation, constructing the following
rather than a long sequence of `sw` and `lw` instructions for saving the
callee-saved registers:
```asm
qc.c.mienter
qc.cm.push {ra, s0-sN}, -M
...
qc.cm.pop {ra, s0-sN}, M
qc.c.mileaveret
```
There are some carefully-worked-out details here, especially around CFI
information. For any register saved by both `qc.c.mienter(.nest)` and
the push (which is `ra` and `s0` at most), we point the CFI information
at the version saved by `qc.c.mienter(.nest)`. This ensures the CFI
points at the same `fp` copy as a frame pointer unwinder would find.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list