[llvm] [RISCV] Added new register class GPRNoGPRS defined as substraction of GPRC sequences from GPR (PR #106974)
Vladislav Belov via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 2 04:39:15 PDT 2024
https://github.com/vbe-sc created https://github.com/llvm/llvm-project/pull/106974
This patch adds new register class allowed to select general purpose registers that can not be used as operands of compressed instructions. It can be useful for some compiler routine and llvm-based RISC-V tools.
>From 2081e7c183138bbdc1c926cef92d42c922f54a34 Mon Sep 17 00:00:00 2001
From: vb-sc <vladislav.belov at syntacore.com>
Date: Mon, 2 Sep 2024 14:32:20 +0300
Subject: [PATCH] [RISCV] Added new register class GPRNoGPRS defined as
substraction of GPRC sequences from GPR
---
llvm/lib/Target/RISCV/RISCVRegisterInfo.td | 3 +++
1 file changed, 3 insertions(+)
diff --git a/llvm/lib/Target/RISCV/RISCVRegisterInfo.td b/llvm/lib/Target/RISCV/RISCVRegisterInfo.td
index 4d5c0a7bef9416..63dcdf72552d5e 100644
--- a/llvm/lib/Target/RISCV/RISCVRegisterInfo.td
+++ b/llvm/lib/Target/RISCV/RISCVRegisterInfo.td
@@ -180,6 +180,9 @@ def GPRJALRNonX7 : GPRRegisterClass<(sub GPRJALR, X7)>;
def GPRC : GPRRegisterClass<(add (sequence "X%u", 10, 15),
(sequence "X%u", 8, 9))>;
+// The list of GPR registers not using with compressed instructions
+def GPRNoGPRC : GPRRegisterClass<(sub GPR, GPRC)>;
+
// For indirect tail calls, we can't use callee-saved registers, as they are
// restored to the saved value before the tail call, which would clobber a call
// address. We shouldn't use x5 since that is a hint for to pop the return
More information about the llvm-commits
mailing list