Skip to content

Commit 17efbfb

Browse files
committed
[RISCV] Add Pseudo for MOPs that representing shadow stack insns
1 parent b3452d9 commit 17efbfb

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2330,7 +2330,6 @@ include "RISCVInstrInfoZalasr.td"
23302330
include "RISCVInstrInfoZimop.td"
23312331
include "RISCVInstrInfoZicbo.td"
23322332
include "RISCVInstrInfoZicond.td"
2333-
include "RISCVInstrInfoZicfiss.td"
23342333
include "RISCVInstrInfoZilsd.td"
23352334

23362335
// Scalar FP
@@ -2359,6 +2358,9 @@ include "RISCVInstrInfoZc.td"
23592358
include "RISCVInstrInfoZcmop.td"
23602359
include "RISCVInstrInfoZclsd.td"
23612360

2361+
// Control Flow Integriy, this requires Zimop/Zcmop
2362+
include "RISCVInstrInfoZicfiss.td"
2363+
23622364
// Short Forward Branch
23632365
include "RISCVInstrInfoSFB.td"
23642366

llvm/lib/Target/RISCV/RISCVInstrInfoZicfiss.td

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,21 @@ defm SSAMOSWAP_W : AMO_rr_aq_rl<0b01001, 0b010, "ssamoswap.w">;
6262
let Predicates = [HasStdExtZicfiss, IsRV64] in
6363
defm SSAMOSWAP_D : AMO_rr_aq_rl<0b01001, 0b011, "ssamoswap.d">;
6464

65+
let Predicates = [HasStdExtZimop] in {
66+
let hasSideEffects = 1, mayLoad = 0, mayStore = 1 in
67+
def PseudoMOP_SSPUSH : Pseudo<(outs), (ins GPRX1X5:$rs2), []>,
68+
PseudoInstExpansion<(MOP_RR_7 X0, X0, GPR:$rs2)>;
69+
let hasSideEffects = 1, mayLoad = 1, mayStore = 0 in
70+
def PseudoMOP_SSPOPCHK : Pseudo<(outs), (ins GPRX1X5:$rs1), []>,
71+
PseudoInstExpansion<(MOP_R_28 X0, GPR:$rs1)>;
72+
} // Predicates = [HasStdExtZimop]
73+
74+
let Predicates = [HasStdExtZcmop] in {
75+
let Uses = [X1], hasSideEffects = 1, mayLoad = 0, mayStore = 1 in
76+
def PseudoMOP_C_SSPUSH : Pseudo<(outs), (ins), []>,
77+
PseudoInstExpansion<(C_MOP_1)>;
78+
} // Predicates = [HasStdExtZcmop]
79+
6580
//===----------------------------------------------------------------------===/
6681
// Compress Instruction tablegen backend.
6782
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)