[PATCH] D151177: [RISCV] Add i32 as a legal type for GPR register class.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 23 10:00:01 PDT 2023
craig.topper updated this revision to Diff 533999.
craig.topper added a comment.
Herald added a subscriber: wangpc.
Rebase
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151177/new/
https://reviews.llvm.org/D151177
Files:
llvm/lib/Target/RISCV/RISCVRegisterInfo.td
Index: llvm/lib/Target/RISCV/RISCVRegisterInfo.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVRegisterInfo.td
+++ llvm/lib/Target/RISCV/RISCVRegisterInfo.td
@@ -124,7 +124,7 @@
// The order of registers represents the preferred allocation sequence.
// Registers are listed in the order caller-save, callee-save, specials.
-def GPR : RegisterClass<"RISCV", [XLenVT, XLenFVT], 32, (add
+def GPR : RegisterClass<"RISCV", [XLenVT, XLenFVT, i32], 32, (add
(sequence "X%u", 10, 17),
(sequence "X%u", 5, 7),
(sequence "X%u", 28, 31),
@@ -135,15 +135,15 @@
let RegInfos = XLenRI;
}
-def GPRX0 : RegisterClass<"RISCV", [XLenVT, XLenFVT], 32, (add X0)> {
+def GPRX0 : RegisterClass<"RISCV", [XLenVT, XLenFVT, i32], 32, (add X0)> {
let RegInfos = XLenRI;
}
-def GPRNoX0 : RegisterClass<"RISCV", [XLenVT, XLenFVT], 32, (sub GPR, X0)> {
+def GPRNoX0 : RegisterClass<"RISCV", [XLenVT, XLenFVT, i32], 32, (sub GPR, X0)> {
let RegInfos = XLenRI;
}
-def GPRNoX0X2 : RegisterClass<"RISCV", [XLenVT, XLenFVT], 32, (sub GPR, X0, X2)> {
+def GPRNoX0X2 : RegisterClass<"RISCV", [XLenVT, XLenFVT, i32], 32, (sub GPR, X0, X2)> {
let RegInfos = XLenRI;
}
@@ -151,11 +151,12 @@
// stack on some microarchitectures. Also remove the reserved registers X0, X2,
// X3, and X4 as it reduces the number of register classes that get synthesized
// by tablegen.
-def GPRJALR : RegisterClass<"RISCV", [XLenVT, XLenFVT], 32, (sub GPR, (sequence "X%u", 0, 5))> {
+def GPRJALR : RegisterClass<"RISCV", [XLenVT, XLenFVT, i32], 32,
+ (sub GPR, (sequence "X%u", 0, 5))> {
let RegInfos = XLenRI;
}
-def GPRC : RegisterClass<"RISCV", [XLenVT, XLenFVT], 32, (add
+def GPRC : RegisterClass<"RISCV", [XLenVT, XLenFVT, i32], 32, (add
(sequence "X%u", 10, 15),
(sequence "X%u", 8, 9)
)> {
@@ -166,7 +167,7 @@
// 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
// address stack on some microarchitectures.
-def GPRTC : RegisterClass<"RISCV", [XLenVT, XLenFVT], 32, (add
+def GPRTC : RegisterClass<"RISCV", [XLenVT, XLenFVT, i32], 32, (add
(sequence "X%u", 6, 7),
(sequence "X%u", 10, 17),
(sequence "X%u", 28, 31)
@@ -174,12 +175,12 @@
let RegInfos = XLenRI;
}
-def SP : RegisterClass<"RISCV", [XLenVT, XLenFVT], 32, (add X2)> {
+def SP : RegisterClass<"RISCV", [XLenVT, XLenFVT, i32], 32, (add X2)> {
let RegInfos = XLenRI;
}
// Saved Registers from s0 to s7, for C.MVA01S07 instruction in Zcmp extension
-def SR07 : RegisterClass<"RISCV", [XLenVT, XLenFVT], 32, (add
+def SR07 : RegisterClass<"RISCV", [XLenVT, XLenFVT, i32], 32, (add
(sequence "X%u", 8, 9),
(sequence "X%u", 18, 23)
)> {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151177.533999.patch
Type: text/x-patch
Size: 2837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230623/96b9b44c/attachment.bin>
More information about the llvm-commits
mailing list