From 2e61cd1295e0031b2379af2b65373e2798a551cb Mon Sep 17 00:00:00 2001 From: Evgeny Leviant Date: Sat, 12 Sep 2020 16:53:12 +0300 Subject: [PATCH] [MachineScheduler] Fix operand scheduling for pre/post-increment loads Differential revision: https://reviews.llvm.org/D87557 --- llvm/lib/Target/AArch64/AArch64InstrFormats.td | 8 ++++---- llvm/test/tools/llvm-mca/AArch64/Exynos/load.s | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/llvm/lib/Target/AArch64/AArch64InstrFormats.td b/llvm/lib/Target/AArch64/AArch64InstrFormats.td index 25d478ebfc05..61155087cbe2 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrFormats.td +++ b/llvm/lib/Target/AArch64/AArch64InstrFormats.td @@ -3939,7 +3939,7 @@ class LoadPreIdx sz, bit V, bits<2> opc, RegisterOperand regtype, (outs GPR64sp:$wback, regtype:$Rt), (ins GPR64sp:$Rn, simm9:$offset), asm, "$Rn = $wback,@earlyclobber $wback", []>, - Sched<[WriteLD, WriteAdr]>; + Sched<[WriteAdr, WriteLD]>; let mayStore = 1, mayLoad = 0 in class StorePreIdx sz, bit V, bits<2> opc, RegisterOperand regtype, @@ -3985,7 +3985,7 @@ class LoadPostIdx sz, bit V, bits<2> opc, RegisterOperand regtype, (outs GPR64sp:$wback, regtype:$Rt), (ins GPR64sp:$Rn, simm9:$offset), asm, "$Rn = $wback,@earlyclobber $wback", []>, - Sched<[WriteLD, WriteAdr]>; + Sched<[WriteAdr, WriteLD]>; let mayStore = 1, mayLoad = 0 in class StorePostIdx sz, bit V, bits<2> opc, RegisterOperand regtype, @@ -4082,7 +4082,7 @@ class LoadPairPreIdx opc, bit V, RegisterOperand regtype, : BaseLoadStorePairPreIdx, - Sched<[WriteLD, WriteLDHi, WriteAdr]>; + Sched<[WriteAdr, WriteLD, WriteLDHi]>; let mayStore = 1, mayLoad = 0 in class StorePairPreIdx opc, bit V, RegisterOperand regtype, @@ -4123,7 +4123,7 @@ class LoadPairPostIdx opc, bit V, RegisterOperand regtype, : BaseLoadStorePairPostIdx, - Sched<[WriteLD, WriteLDHi, WriteAdr]>; + Sched<[WriteAdr, WriteLD, WriteLDHi]>; let mayStore = 1, mayLoad = 0 in class StorePairPostIdx opc, bit V, RegisterOperand regtype, diff --git a/llvm/test/tools/llvm-mca/AArch64/Exynos/load.s b/llvm/test/tools/llvm-mca/AArch64/Exynos/load.s index 04f30d353ae0..2e90e5ab6f16 100644 --- a/llvm/test/tools/llvm-mca/AArch64/Exynos/load.s +++ b/llvm/test/tools/llvm-mca/AArch64/Exynos/load.s @@ -20,7 +20,7 @@ ldpsw x0, x1, [sp, #8]! # ALL: Iterations: 100 # ALL-NEXT: Instructions: 1200 -# ALL-NEXT: Total Cycles: 1904 +# ALL-NEXT: Total Cycles: 1304 # M3-NEXT: Total uOps: 1600 # M4-NEXT: Total uOps: 1400 @@ -28,11 +28,11 @@ ldpsw x0, x1, [sp, #8]! # ALL: Dispatch Width: 6 -# M3-NEXT: uOps Per Cycle: 0.84 -# M4-NEXT: uOps Per Cycle: 0.74 -# M5-NEXT: uOps Per Cycle: 0.74 +# M3-NEXT: uOps Per Cycle: 1.23 +# M4-NEXT: uOps Per Cycle: 1.07 +# M5-NEXT: uOps Per Cycle: 1.07 -# ALL-NEXT: IPC: 0.63 +# ALL-NEXT: IPC: 0.92 # ALL-NEXT: Block RThroughput: 6.0 # ALL: Instruction Info: