Skip to content

Commit 922558f

Browse files
authored
[RISCV] Remove registers from ins of Priv instructions. (llvm#100857)
The rd and rs1 encoding are already forced to 0s. We don't need registers too.
1 parent 7647f88 commit 922558f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.td

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,7 @@ class ALUW_rr<bits<7> funct7, bits<3> funct3, string opcodestr,
593593

594594
let hasSideEffects = 1, mayLoad = 0, mayStore = 0 in
595595
class Priv<string opcodestr, bits<7> funct7>
596-
: RVInstR<funct7, 0b000, OPC_SYSTEM, (outs), (ins GPR:$rs1, GPR:$rs2),
597-
opcodestr, "">;
596+
: RVInstR<funct7, 0b000, OPC_SYSTEM, (outs), (ins), opcodestr, "">;
598597

599598
let hasSideEffects = 1, mayLoad = 0, mayStore = 0 in
600599
class Priv_rr<string opcodestr, bits<7> funct7>
@@ -1543,8 +1542,8 @@ def PseudoCALL : Pseudo<(outs), (ins call_symbol:$func), [],
15431542
def : Pat<(riscv_call tglobaladdr:$func), (PseudoCALL tglobaladdr:$func)>;
15441543
def : Pat<(riscv_call texternalsym:$func), (PseudoCALL texternalsym:$func)>;
15451544

1546-
def : Pat<(riscv_sret_glue), (SRET (XLenVT X0), (XLenVT X0))>;
1547-
def : Pat<(riscv_mret_glue), (MRET (XLenVT X0), (XLenVT X0))>;
1545+
def : Pat<(riscv_sret_glue), (SRET)>;
1546+
def : Pat<(riscv_mret_glue), (MRET)>;
15481547

15491548
let isCall = 1, Defs = [X1] in {
15501549
let Predicates = [NoStdExtZicfilp] in

0 commit comments

Comments
 (0)