From 0461d2ba6bf1aedbd0d39e5da4daf90137bf61a7 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Wed, 19 Aug 2026 02:59:49 +0800 Subject: [RISCV][GlobalISel] Generate select instruction matching --- backend/lib/Target/RISCV/RISCVGISelInteger.rccdesc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'backend/lib/Target/RISCV/RISCVGISelInteger.rccdesc') diff --git a/backend/lib/Target/RISCV/RISCVGISelInteger.rccdesc b/backend/lib/Target/RISCV/RISCVGISelInteger.rccdesc index f40e5d4..d217460 100644 --- a/backend/lib/Target/RISCV/RISCVGISelInteger.rccdesc +++ b/backend/lib/Target/RISCV/RISCVGISelInteger.rccdesc @@ -913,6 +913,27 @@ selection_rules: - { temporary: compare, flags: [use] } - { immediate: 1 } erase_operand_definitions: [3] + - + id: select_g_select_gpr + priority: 100 + match: + opcode: G_SELECT + operand_banks: + - { index: 0, bank: GPR } + - { index: 1, bank: GPR } + - { index: 2, bank: GPR } + - { index: 3, bank: GPR } + apply: + instructions: + - opcode: Select_GPR_Using_CC_GPR + root: true + operands: + - { operand: 0 } + - { complex: select_condition_lhs, operand: 1 } + - { complex: select_condition_rhs, operand: 1 } + - { complex: select_condition_code, operand: 1 } + - { operand: 2 } + - { operand: 3 } - id: select_g_icmp_sgt_immediate priority: 400 -- cgit v1.2.3