[llvm] [RISCV] Disable shrink wrapping for SiFive CLIC preemptible handlers (PR #218347)
Zeyi Xu via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 01:38:06 PDT 2026
================
@@ -0,0 +1,25 @@
+; RUN: llc -mtriple=riscv32 -mattr=+experimental-xsfmclic \
+; RUN: -verify-machineinstrs < %s | FileCheck %s
+; RUN: llc -mtriple=riscv64 -mattr=+experimental-xsfmclic \
+; RUN: -verify-machineinstrs < %s | FileCheck %s
+
+declare ptr @llvm.thread.pointer()
+declare void @panic() noreturn
+
+define void @handler() "interrupt"="SiFive-CLIC-preemptible" {
+; CHECK-LABEL: handler:
+; CHECK: csrsi mstatus, 8
----------------
zeyi2 wrote:
`beqz tp` is the first branch from the handler body. This verifies that the mandatory preemption setup (`csrsi mstatus, 8`) remains in the entry block and executes before the handler body.
The required ordering is described [here](https://github.com/riscv/riscv-fast-interrupt/blob/faa80cf62e8349e5619c1776009cbdd5d5a010c1/src/clic.adoc?plain=1#L2252-L2269).
https://github.com/llvm/llvm-project/pull/218347
More information about the llvm-commits
mailing list