From c0f2700e0c7effc5da267bf501232ff4bfea63bc Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Wed, 19 Aug 2026 03:08:38 +0800 Subject: [RISCV][GlobalISel] Generate trap selection --- backend/lib/Target/RISCV/RISCVGISelControlFlow.rccdesc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'backend/lib/Target/RISCV/RISCVGISelControlFlow.rccdesc') diff --git a/backend/lib/Target/RISCV/RISCVGISelControlFlow.rccdesc b/backend/lib/Target/RISCV/RISCVGISelControlFlow.rccdesc index 21fd338..7f8b67c 100644 --- a/backend/lib/Target/RISCV/RISCVGISelControlFlow.rccdesc +++ b/backend/lib/Target/RISCV/RISCVGISelControlFlow.rccdesc @@ -1,6 +1,22 @@ # SPDX-License-Identifier: GPL-3.0-or-later selection_rules: + - + id: select_g_trap + priority: 100 + match: + opcode: G_TRAP + apply: + instructions: + - { opcode: UNIMP, root: true, operands: [] } + - + id: select_g_debugtrap + priority: 100 + match: + opcode: G_DEBUGTRAP + apply: + instructions: + - { opcode: EBREAK, root: true, operands: [] } - id: select_g_brindirect priority: 100 -- cgit v1.2.3