From f51170bffd507b872df228cb8c7512fe0389b7cf Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 28 Nov 2022 17:43:10 +0000 Subject: [PATCH] [X86] Fix SLM ldmxcsr/stmxcsr schedule classes Fix a long standing FIXME comment using a mixture of llvm-exegesis and Agner numbers --- llvm/lib/Target/X86/X86ScheduleSLM.td | 5 ++--- llvm/test/tools/llvm-mca/X86/SLM/resources-sse1.s | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/llvm/lib/Target/X86/X86ScheduleSLM.td b/llvm/lib/Target/X86/X86ScheduleSLM.td index 9025914..e186168 100644 --- a/llvm/lib/Target/X86/X86ScheduleSLM.td +++ b/llvm/lib/Target/X86/X86ScheduleSLM.td @@ -91,9 +91,8 @@ def : WriteRes; defm : X86WriteResUnsupported; // Load/store MXCSR. -// FIXME: These are probably wrong. They are copy pasted from WriteStore/Load. -def : WriteRes; -def : WriteRes { let Latency = 3; } +defm : X86WriteRes; +defm : X86WriteRes; // Treat misc copies as a move. def : InstRW<[WriteMove], (instrs COPY)>; diff --git a/llvm/test/tools/llvm-mca/X86/SLM/resources-sse1.s b/llvm/test/tools/llvm-mca/X86/SLM/resources-sse1.s index a84a325..2362fe8 100644 --- a/llvm/test/tools/llvm-mca/X86/SLM/resources-sse1.s +++ b/llvm/test/tools/llvm-mca/X86/SLM/resources-sse1.s @@ -230,7 +230,7 @@ xorps (%rax), %xmm2 # CHECK-NEXT: 7 42 39.00 * divps (%rax), %xmm2 # CHECK-NEXT: 1 19 17.00 divss %xmm0, %xmm2 # CHECK-NEXT: 1 22 17.00 * divss (%rax), %xmm2 -# CHECK-NEXT: 1 3 1.00 * * U ldmxcsr (%rax) +# CHECK-NEXT: 5 10 8.00 * * U ldmxcsr (%rax) # CHECK-NEXT: 1 1 1.00 * * U maskmovq %mm0, %mm1 # CHECK-NEXT: 1 3 1.00 maxps %xmm0, %xmm2 # CHECK-NEXT: 1 6 1.00 * maxps (%rax), %xmm2 @@ -305,7 +305,7 @@ xorps (%rax), %xmm2 # CHECK-NEXT: 6 44 40.00 * sqrtps (%rax), %xmm2 # CHECK-NEXT: 1 20 20.00 sqrtss %xmm0, %xmm2 # CHECK-NEXT: 1 23 20.00 * sqrtss (%rax), %xmm2 -# CHECK-NEXT: 1 1 1.00 * U stmxcsr (%rax) +# CHECK-NEXT: 4 12 11.00 * U stmxcsr (%rax) # CHECK-NEXT: 1 3 1.00 subps %xmm0, %xmm2 # CHECK-NEXT: 1 6 1.00 * subps (%rax), %xmm2 # CHECK-NEXT: 1 3 1.00 subss %xmm0, %xmm2 @@ -331,7 +331,7 @@ xorps (%rax), %xmm2 # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] -# CHECK-NEXT: - 232.00 8.00 108.00 37.00 0.50 0.50 67.00 +# CHECK-NEXT: - 232.00 8.00 108.00 37.00 - - 84.00 # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] Instructions: @@ -371,7 +371,7 @@ xorps (%rax), %xmm2 # CHECK-NEXT: - 39.00 - 1.00 - - - 1.00 divps (%rax), %xmm2 # CHECK-NEXT: - 17.00 - 1.00 - - - - divss %xmm0, %xmm2 # CHECK-NEXT: - 17.00 - 1.00 - - - 1.00 divss (%rax), %xmm2 -# CHECK-NEXT: - - - - - - - 1.00 ldmxcsr (%rax) +# CHECK-NEXT: - - - - - - - 8.00 ldmxcsr (%rax) # CHECK-NEXT: - - - 1.00 - - - - maskmovq %mm0, %mm1 # CHECK-NEXT: - - - - 1.00 - - - maxps %xmm0, %xmm2 # CHECK-NEXT: - - - - 1.00 - - 1.00 maxps (%rax), %xmm2 @@ -446,7 +446,7 @@ xorps (%rax), %xmm2 # CHECK-NEXT: - 40.00 - 1.00 - - - 1.00 sqrtps (%rax), %xmm2 # CHECK-NEXT: - 20.00 - 1.00 - - - - sqrtss %xmm0, %xmm2 # CHECK-NEXT: - 20.00 - 1.00 - - - 1.00 sqrtss (%rax), %xmm2 -# CHECK-NEXT: - - - - - 0.50 0.50 1.00 stmxcsr (%rax) +# CHECK-NEXT: - - - - - - - 11.00 stmxcsr (%rax) # CHECK-NEXT: - - - - 1.00 - - - subps %xmm0, %xmm2 # CHECK-NEXT: - - - - 1.00 - - 1.00 subps (%rax), %xmm2 # CHECK-NEXT: - - - - 1.00 - - - subss %xmm0, %xmm2 -- 2.7.4