[llvm] cdb9146 - [RISCV] Remove WriteJmpReg. Use WriteJalr in its place.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 25 21:59:40 PDT 2023
Author: Craig Topper
Date: 2023-06-25T21:59:27-07:00
New Revision: cdb91465e34d12b22c143847eb5fdb278ecf7689
URL: https://github.com/llvm/llvm-project/commit/cdb91465e34d12b22c143847eb5fdb278ecf7689
DIFF: https://github.com/llvm/llvm-project/commit/cdb91465e34d12b22c143847eb5fdb278ecf7689.diff
LOG: [RISCV] Remove WriteJmpReg. Use WriteJalr in its place.
It was only used for the compressed instruction c.jr which expands
to jalr with rd=x0. Use WriteJalr instead to match jalr.
Added:
Modified:
llvm/lib/Target/RISCV/RISCVInstrInfoC.td
llvm/lib/Target/RISCV/RISCVSchedRocket.td
llvm/lib/Target/RISCV/RISCVSchedSiFive7.td
llvm/lib/Target/RISCV/RISCVSchedSyntacoreSCR1.td
llvm/lib/Target/RISCV/RISCVSchedule.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoC.td b/llvm/lib/Target/RISCV/RISCVInstrInfoC.td
index e3a026f147dfb..22acb94ef26f4 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoC.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoC.td
@@ -551,7 +551,7 @@ def C_LDSP : CStackLoad<0b011, "c.ldsp", GPRNoX0, uimm9_lsb000>,
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
def C_JR : RVInst16CR<0b1000, 0b10, (outs), (ins GPRNoX0:$rs1),
- "c.jr", "$rs1">, Sched<[WriteJmpReg, ReadJalr]> {
+ "c.jr", "$rs1">, Sched<[WriteJalr, ReadJalr]> {
let isBarrier = 1;
let isTerminator = 1;
let rs2 = 0;
diff --git a/llvm/lib/Target/RISCV/RISCVSchedRocket.td b/llvm/lib/Target/RISCV/RISCVSchedRocket.td
index a92c0770bfadd..b14cdd40f154a 100644
--- a/llvm/lib/Target/RISCV/RISCVSchedRocket.td
+++ b/llvm/lib/Target/RISCV/RISCVSchedRocket.td
@@ -51,7 +51,6 @@ let SchedModel = RocketModel in {
def : WriteRes<WriteJmp, [RocketUnitB]>;
def : WriteRes<WriteJal, [RocketUnitB]>;
def : WriteRes<WriteJalr, [RocketUnitB]>;
-def : WriteRes<WriteJmpReg, [RocketUnitB]>;
// Integer arithmetic and logic
def : WriteRes<WriteIALU32, [RocketUnitALU]>;
diff --git a/llvm/lib/Target/RISCV/RISCVSchedSiFive7.td b/llvm/lib/Target/RISCV/RISCVSchedSiFive7.td
index 72a5fca64ee37..c4575be90e632 100644
--- a/llvm/lib/Target/RISCV/RISCVSchedSiFive7.td
+++ b/llvm/lib/Target/RISCV/RISCVSchedSiFive7.td
@@ -252,7 +252,6 @@ let Latency = 3 in {
def : WriteRes<WriteJmp, [SiFive7PipeB]>;
def : WriteRes<WriteJal, [SiFive7PipeB]>;
def : WriteRes<WriteJalr, [SiFive7PipeB]>;
-def : WriteRes<WriteJmpReg, [SiFive7PipeB]>;
}
//Short forward branch
diff --git a/llvm/lib/Target/RISCV/RISCVSchedSyntacoreSCR1.td b/llvm/lib/Target/RISCV/RISCVSchedSyntacoreSCR1.td
index 4016b9f8cbee0..41eefa0c67d93 100644
--- a/llvm/lib/Target/RISCV/RISCVSchedSyntacoreSCR1.td
+++ b/llvm/lib/Target/RISCV/RISCVSchedSyntacoreSCR1.td
@@ -41,7 +41,6 @@ def SCR1_CFU : ProcResource<1>;
def : WriteRes<WriteJmp, [SCR1_CFU]>;
def : WriteRes<WriteJal, [SCR1_CFU]>;
def : WriteRes<WriteJalr, [SCR1_CFU]>;
-def : WriteRes<WriteJmpReg, [SCR1_CFU]>;
// Integer arithmetic and logic
def : WriteRes<WriteIALU32, [SCR1_ALU]>;
diff --git a/llvm/lib/Target/RISCV/RISCVSchedule.td b/llvm/lib/Target/RISCV/RISCVSchedule.td
index c92e9408c53ef..af318ea5bf685 100644
--- a/llvm/lib/Target/RISCV/RISCVSchedule.td
+++ b/llvm/lib/Target/RISCV/RISCVSchedule.td
@@ -20,7 +20,6 @@ def WriteIMul32 : SchedWrite; // 32-bit multiply on RV64I
def WriteJmp : SchedWrite; // Jump
def WriteJal : SchedWrite; // Jump and link
def WriteJalr : SchedWrite; // Jump and link register
-def WriteJmpReg : SchedWrite; // Jump register
def WriteNop : SchedWrite;
def WriteLDB : SchedWrite; // Load byte
def WriteLDH : SchedWrite; // Load half-word
More information about the llvm-commits
mailing list