[llvm] 3cbd56d - [RISCV] Add missing Read classes to some compressed instructions.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 25 00:55:59 PDT 2023
Author: Craig Topper
Date: 2023-06-25T00:48:26-07:00
New Revision: 3cbd56dca11f2ec4d1131152e3b3ae43ded5432e
URL: https://github.com/llvm/llvm-project/commit/3cbd56dca11f2ec4d1131152e3b3ae43ded5432e
DIFF: https://github.com/llvm/llvm-project/commit/3cbd56dca11f2ec4d1131152e3b3ae43ded5432e.diff
LOG: [RISCV] Add missing Read classes to some compressed instructions.
Reviewed By: wangpc
Differential Revision: https://reviews.llvm.org/D153669
Added:
Modified:
llvm/lib/Target/RISCV/RISCVInstrInfoC.td
llvm/test/tools/llvm-mca/RISCV/SiFive7/gpr-bypass-c.s
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoC.td b/llvm/lib/Target/RISCV/RISCVInstrInfoC.td
index a26d791a4cbdd..e3a026f147dfb 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoC.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoC.td
@@ -509,8 +509,8 @@ def C_J : RVInst16CJ<0b101, 0b01, (outs), (ins simm12_lsb0:$offset),
let isBarrier=1;
}
-def C_BEQZ : Bcz<0b110, "c.beqz", GPRC>, Sched<[WriteJmp]>;
-def C_BNEZ : Bcz<0b111, "c.bnez", GPRC>, Sched<[WriteJmp]>;
+def C_BEQZ : Bcz<0b110, "c.beqz", GPRC>, Sched<[WriteJmp, ReadJmp]>;
+def C_BNEZ : Bcz<0b111, "c.bnez", GPRC>, Sched<[WriteJmp, ReadJmp]>;
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
def C_SLLI : RVInst16CI<0b000, 0b10, (outs GPRNoX0:$rd_wb),
@@ -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]> {
+ "c.jr", "$rs1">, Sched<[WriteJmpReg, ReadJalr]> {
let isBarrier = 1;
let isTerminator = 1;
let rs2 = 0;
diff --git a/llvm/test/tools/llvm-mca/RISCV/SiFive7/gpr-bypass-c.s b/llvm/test/tools/llvm-mca/RISCV/SiFive7/gpr-bypass-c.s
index a40d88d1db1eb..cc5ea2d2ab18a 100644
--- a/llvm/test/tools/llvm-mca/RISCV/SiFive7/gpr-bypass-c.s
+++ b/llvm/test/tools/llvm-mca/RISCV/SiFive7/gpr-bypass-c.s
@@ -25,12 +25,12 @@ bnez a0, 1f
# CHECK: Iterations: 1
# CHECK-NEXT: Instructions: 18
-# CHECK-NEXT: Total Cycles: 24
+# CHECK-NEXT: Total Cycles: 20
# CHECK-NEXT: Total uOps: 18
# CHECK: Dispatch Width: 2
-# CHECK-NEXT: uOps Per Cycle: 0.75
-# CHECK-NEXT: IPC: 0.75
+# CHECK-NEXT: uOps Per Cycle: 0.90
+# CHECK-NEXT: IPC: 0.90
# CHECK-NEXT: Block RThroughput: 9.0
# CHECK: Instruction Info:
@@ -98,26 +98,26 @@ bnez a0, 1f
# CHECK: Timeline view:
# CHECK-NEXT: 0123456789
-# CHECK-NEXT: Index 0123456789 0123
+# CHECK-NEXT: Index 0123456789
-# CHECK: [0,0] DeeE . . . . . lui a0, 1
-# CHECK-NEXT: [0,1] .DeeE. . . . . add a0, a0, a0
-# CHECK-NEXT: [0,2] . DeeE . . . . addi a0, a0, 1
-# CHECK-NEXT: [0,3] . DeeE . . . . addw a0, a0, a0
-# CHECK-NEXT: [0,4] . DeeE . . . . addiw a0, a0, 1
-# CHECK-NEXT: [0,5] . DeeE . . . . sub a0, a0, a0
-# CHECK-NEXT: [0,6] . .DeeE. . . . subw a0, a0, a0
-# CHECK-NEXT: [0,7] . . DeeE . . . and a0, a0, a0
-# CHECK-NEXT: [0,8] . . DeeE . . . andi a0, a0, 1
-# CHECK-NEXT: [0,9] . . DeeE . . . or a0, a0, a0
-# CHECK-NEXT: [0,10] . . DeeE . . . xor a0, a0, a0
-# CHECK-NEXT: [0,11] . . .DeeE. . . slli a0, a0, 1
-# CHECK-NEXT: [0,12] . . . DeeE . . srli a0, a0, 1
-# CHECK-NEXT: [0,13] . . . DeeE . . srai a0, a0, 1
-# CHECK-NEXT: [0,14] . . . DeeE . . add a0, a0, a0
-# CHECK-NEXT: [0,15] . . . . DeeE . beqz a0, .Ltmp0
-# CHECK-NEXT: [0,16] . . . . DeeE . add a0, a0, a0
-# CHECK-NEXT: [0,17] . . . . DeeE bnez a0, .Ltmp1
+# CHECK: [0,0] DeeE . . . . lui a0, 1
+# CHECK-NEXT: [0,1] .DeeE. . . . add a0, a0, a0
+# CHECK-NEXT: [0,2] . DeeE . . . addi a0, a0, 1
+# CHECK-NEXT: [0,3] . DeeE . . . addw a0, a0, a0
+# CHECK-NEXT: [0,4] . DeeE . . . addiw a0, a0, 1
+# CHECK-NEXT: [0,5] . DeeE . . . sub a0, a0, a0
+# CHECK-NEXT: [0,6] . .DeeE. . . subw a0, a0, a0
+# CHECK-NEXT: [0,7] . . DeeE . . and a0, a0, a0
+# CHECK-NEXT: [0,8] . . DeeE . . andi a0, a0, 1
+# CHECK-NEXT: [0,9] . . DeeE . . or a0, a0, a0
+# CHECK-NEXT: [0,10] . . DeeE . . xor a0, a0, a0
+# CHECK-NEXT: [0,11] . . .DeeE. . slli a0, a0, 1
+# CHECK-NEXT: [0,12] . . . DeeE . srli a0, a0, 1
+# CHECK-NEXT: [0,13] . . . DeeE . srai a0, a0, 1
+# CHECK-NEXT: [0,14] . . . DeeE . add a0, a0, a0
+# CHECK-NEXT: [0,15] . . . DeeE. beqz a0, .Ltmp0
+# CHECK-NEXT: [0,16] . . . DeeE. add a0, a0, a0
+# CHECK-NEXT: [0,17] . . . .DeeE bnez a0, .Ltmp1
# CHECK: Average Wait times (based on the timeline view):
# CHECK-NEXT: [0]: Executions
More information about the llvm-commits
mailing list