Skip to content

Commit a5a33d8

Browse files
committed
[RISCV] Move let Constraints closer to where outs/ins are declared in RISCVInstrInfoXCV.td. NFC
The Constraint refers to the ins/outs register names so should be as close as they can be.
1 parent 4a76c20 commit a5a33d8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class CVInstMac<bits<7> funct7, bits<3> funct3, string opcodestr>
7474
: RVInstR<funct7, funct3, OPC_CUSTOM_1,
7575
(outs GPR:$rd_wb), (ins GPR:$rd, GPR:$rs1, GPR:$rs2),
7676
opcodestr, "$rd, $rs1, $rs2"> {
77+
let Constraints = "$rd = $rd_wb";
7778
let DecoderNamespace = "XCV";
7879
}
7980

@@ -90,14 +91,16 @@ class CVInstMacMulN<bits<2> funct2, bits<3> funct3, dag outs, dag ins,
9091

9192
class CVInstMacN<bits<2> funct2, bits<3> funct3, string opcodestr>
9293
: CVInstMacMulN<funct2, funct3, (outs GPR:$rd_wb),
93-
(ins GPR:$rd, GPR:$rs1, GPR:$rs2, uimm5:$imm5), opcodestr>;
94+
(ins GPR:$rd, GPR:$rs1, GPR:$rs2, uimm5:$imm5), opcodestr> {
95+
let Constraints = "$rd = $rd_wb";
96+
}
9497

9598
class CVInstMulN<bits<2> funct2, bits<3> funct3, string opcodestr>
9699
: CVInstMacMulN<funct2, funct3, (outs GPR:$rd),
97100
(ins GPR:$rs1, GPR:$rs2, uimm5:$imm5), opcodestr>;
98101

99102
let Predicates = [HasVendorXCVmac, IsRV32], hasSideEffects = 0, mayLoad = 0,
100-
mayStore = 0, Constraints = "$rd = $rd_wb" in {
103+
mayStore = 0 in {
101104
// 32x32 bit macs
102105
def CV_MAC : CVInstMac<0b1001000, 0b011, "cv.mac">,
103106
Sched<[]>;
@@ -179,7 +182,9 @@ let DecoderNamespace = "XCV" in {
179182

180183
class CVInstAluRRNR<bits<7> funct7, bits<3> funct3, string opcodestr>
181184
: RVInstR<funct7, funct3, OPC_CUSTOM_1, (outs GPR:$rd_wb),
182-
(ins GPR:$rd, GPR:$rs1, GPR:$rs2), opcodestr, "$rd, $rs1, $rs2">;
185+
(ins GPR:$rd, GPR:$rs1, GPR:$rs2), opcodestr, "$rd, $rs1, $rs2"> {
186+
let Constraints = "$rd = $rd_wb";
187+
}
183188

184189
class CVInstAluRI<bits<7> funct7, bits<3> funct3, string opcodestr>
185190
: RVInstIBase<funct3, OPC_CUSTOM_1, (outs GPR:$rd),
@@ -254,8 +259,7 @@ let Predicates = [HasVendorXCValu, IsRV32],
254259
// hasSideEffects = 0, mayLoad = 0, mayStore = 0
255260

256261
let Predicates = [HasVendorXCValu, IsRV32],
257-
hasSideEffects = 0, mayLoad = 0, mayStore = 0,
258-
Constraints = "$rd = $rd_wb" in {
262+
hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
259263
def CV_ADDNR : CVInstAluRRNR<0b1000000, 0b011, "cv.addnr">,
260264
Sched<[]>;
261265
def CV_ADDUNR : CVInstAluRRNR<0b1000001, 0b011, "cv.addunr">,
@@ -275,7 +279,6 @@ let Predicates = [HasVendorXCValu, IsRV32],
275279

276280
} // Predicates = [HasVendorXCValu, IsRV32],
277281
// hasSideEffects = 0, mayLoad = 0, mayStore = 0,
278-
// Constraints = "$rd = $rd_wb"
279282

280283
let Predicates = [HasVendorXCValu, IsRV32] in {
281284
def : MnemonicAlias<"cv.slet", "cv.sle">;

0 commit comments

Comments
 (0)