diff --git a/llvm/lib/Target/RISCV/RISCVRegisterInfo.td b/llvm/lib/Target/RISCV/RISCVRegisterInfo.td --- a/llvm/lib/Target/RISCV/RISCVRegisterInfo.td +++ b/llvm/lib/Target/RISCV/RISCVRegisterInfo.td @@ -138,27 +138,11 @@ let RegInfos = XLenRI; } -// The order of registers represents the preferred allocation sequence. -// Registers are listed in the order caller-save, callee-save, specials. -def GPRNoX0 : RegisterClass<"RISCV", [XLenVT], 32, (add - (sequence "X%u", 10, 17), - (sequence "X%u", 5, 7), - (sequence "X%u", 28, 31), - (sequence "X%u", 8, 9), - (sequence "X%u", 18, 27), - (sequence "X%u", 1, 4) - )> { +def GPRNoX0 : RegisterClass<"RISCV", [XLenVT], 32, (sub GPR, X0)> { let RegInfos = XLenRI; } -def GPRNoX0X2 : RegisterClass<"RISCV", [XLenVT], 32, (add - (sequence "X%u", 10, 17), - (sequence "X%u", 5, 7), - (sequence "X%u", 28, 31), - (sequence "X%u", 8, 9), - (sequence "X%u", 18, 27), - X1, X3, X4 - )> { +def GPRNoX0X2 : RegisterClass<"RISCV", [XLenVT], 32, (sub GPR, X0, X2)> { let RegInfos = XLenRI; } @@ -166,13 +150,7 @@ // 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], 32, (add - (sequence "X%u", 10, 17), - (sequence "X%u", 6, 7), - (sequence "X%u", 28, 31), - (sequence "X%u", 8, 9), - (sequence "X%u", 18, 27) - )> { +def GPRJALR : RegisterClass<"RISCV", [XLenVT], 32, (sub GPR, (sequence "X%u", 0, 5))> { let RegInfos = XLenRI; }