From b781ca4df65bcdd72abc121e30d2fc743a25720c Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 5 Nov 2022 13:57:07 +0000 Subject: [PATCH] [X86] Fix override for CVTPD2PS/CVTPD2DQ/CVTTPD2DQ AVX variants These were lost when they were converted from instregex to instrs --- llvm/lib/Target/X86/X86SchedBroadwell.td | 6 +++--- llvm/lib/Target/X86/X86SchedHaswell.td | 6 +++--- llvm/test/tools/llvm-mca/X86/Broadwell/resources-avx1.s | 14 +++++++------- llvm/test/tools/llvm-mca/X86/Haswell/resources-avx1.s | 14 +++++++------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/llvm/lib/Target/X86/X86SchedBroadwell.td b/llvm/lib/Target/X86/X86SchedBroadwell.td index 3c6a6a5..84b36f1 100644 --- a/llvm/lib/Target/X86/X86SchedBroadwell.td +++ b/llvm/lib/Target/X86/X86SchedBroadwell.td @@ -1245,9 +1245,9 @@ def BWWriteResGroup107 : SchedWriteRes<[BWPort1,BWPort5,BWPort23]> { let NumMicroOps = 3; let ResourceCycles = [1,1,1]; } -def: InstRW<[BWWriteResGroup107], (instrs CVTPD2PSrm, - CVTPD2DQrm, - CVTTPD2DQrm)>; +def: InstRW<[BWWriteResGroup107], (instrs CVTPD2PSrm, VCVTPD2PSrm, + CVTPD2DQrm, VCVTPD2DQrm, + CVTTPD2DQrm, VCVTTPD2DQrm)>; def: InstRW<[BWWriteResGroup107], (instregex "MMX_CVT(T?)PD2PIrm", "(V?)CVTSD2SSrm")>; diff --git a/llvm/lib/Target/X86/X86SchedHaswell.td b/llvm/lib/Target/X86/X86SchedHaswell.td index b759423..4c646d4 100644 --- a/llvm/lib/Target/X86/X86SchedHaswell.td +++ b/llvm/lib/Target/X86/X86SchedHaswell.td @@ -1428,9 +1428,9 @@ def HWWriteResGroup78 : SchedWriteRes<[HWPort1,HWPort5,HWPort23]> { let NumMicroOps = 3; let ResourceCycles = [1,1,1]; } -def: InstRW<[HWWriteResGroup78], (instrs CVTPD2PSrm, - CVTPD2DQrm, - CVTTPD2DQrm, +def: InstRW<[HWWriteResGroup78], (instrs CVTPD2PSrm, VCVTPD2PSrm, + CVTPD2DQrm, VCVTPD2DQrm, + CVTTPD2DQrm, VCVTTPD2DQrm, MMX_CVTPD2PIrm, MMX_CVTTPD2PIrm)>; diff --git a/llvm/test/tools/llvm-mca/X86/Broadwell/resources-avx1.s b/llvm/test/tools/llvm-mca/X86/Broadwell/resources-avx1.s index bc98992..f69fed1 100644 --- a/llvm/test/tools/llvm-mca/X86/Broadwell/resources-avx1.s +++ b/llvm/test/tools/llvm-mca/X86/Broadwell/resources-avx1.s @@ -1123,11 +1123,11 @@ vzeroupper # CHECK-NEXT: 1 3 1.00 vcvtdq2ps %ymm0, %ymm2 # CHECK-NEXT: 2 9 1.00 * vcvtdq2ps (%rax), %ymm2 # CHECK-NEXT: 2 4 1.00 vcvtpd2dq %xmm0, %xmm2 -# CHECK-NEXT: 2 8 1.00 * vcvtpd2dqx (%rax), %xmm2 +# CHECK-NEXT: 3 9 1.00 * vcvtpd2dqx (%rax), %xmm2 # CHECK-NEXT: 2 6 1.00 vcvtpd2dq %ymm0, %xmm2 # CHECK-NEXT: 2 8 1.00 * vcvtpd2dqy (%rax), %xmm2 # CHECK-NEXT: 2 4 1.00 vcvtpd2ps %xmm0, %xmm2 -# CHECK-NEXT: 2 8 1.00 * vcvtpd2psx (%rax), %xmm2 +# CHECK-NEXT: 3 9 1.00 * vcvtpd2psx (%rax), %xmm2 # CHECK-NEXT: 2 6 1.00 vcvtpd2ps %ymm0, %xmm2 # CHECK-NEXT: 2 8 1.00 * vcvtpd2psy (%rax), %xmm2 # CHECK-NEXT: 1 3 1.00 vcvtps2dq %xmm0, %xmm2 @@ -1159,7 +1159,7 @@ vzeroupper # CHECK-NEXT: 3 9 1.00 * vcvtss2si (%rax), %ecx # CHECK-NEXT: 3 9 1.00 * vcvtss2si (%rax), %rcx # CHECK-NEXT: 2 4 1.00 vcvttpd2dq %xmm0, %xmm2 -# CHECK-NEXT: 2 8 1.00 * vcvttpd2dqx (%rax), %xmm2 +# CHECK-NEXT: 3 9 1.00 * vcvttpd2dqx (%rax), %xmm2 # CHECK-NEXT: 2 6 1.00 vcvttpd2dq %ymm0, %xmm2 # CHECK-NEXT: 2 8 1.00 * vcvttpd2dqy (%rax), %xmm2 # CHECK-NEXT: 1 3 1.00 vcvttps2dq %xmm0, %xmm2 @@ -1736,7 +1736,7 @@ vzeroupper # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] -# CHECK-NEXT: - 257.00 215.25 235.25 176.17 176.17 38.00 426.25 2.25 12.67 +# CHECK-NEXT: - 257.00 215.25 235.25 176.17 176.17 38.00 429.25 2.25 12.67 # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] Instructions: @@ -1833,11 +1833,11 @@ vzeroupper # CHECK-NEXT: - - - 1.00 - - - - - - vcvtdq2ps %ymm0, %ymm2 # CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvtdq2ps (%rax), %ymm2 # CHECK-NEXT: - - - 1.00 - - - 1.00 - - vcvtpd2dq %xmm0, %xmm2 -# CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvtpd2dqx (%rax), %xmm2 +# CHECK-NEXT: - - - 1.00 0.50 0.50 - 1.00 - - vcvtpd2dqx (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - - - 1.00 - - vcvtpd2dq %ymm0, %xmm2 # CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvtpd2dqy (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - - - 1.00 - - vcvtpd2ps %xmm0, %xmm2 -# CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvtpd2psx (%rax), %xmm2 +# CHECK-NEXT: - - - 1.00 0.50 0.50 - 1.00 - - vcvtpd2psx (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - - - 1.00 - - vcvtpd2ps %ymm0, %xmm2 # CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvtpd2psy (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - - - - - - vcvtps2dq %xmm0, %xmm2 @@ -1869,7 +1869,7 @@ vzeroupper # CHECK-NEXT: - - 1.00 1.00 0.50 0.50 - - - - vcvtss2si (%rax), %ecx # CHECK-NEXT: - - 1.00 1.00 0.50 0.50 - - - - vcvtss2si (%rax), %rcx # CHECK-NEXT: - - - 1.00 - - - 1.00 - - vcvttpd2dq %xmm0, %xmm2 -# CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvttpd2dqx (%rax), %xmm2 +# CHECK-NEXT: - - - 1.00 0.50 0.50 - 1.00 - - vcvttpd2dqx (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - - - 1.00 - - vcvttpd2dq %ymm0, %xmm2 # CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvttpd2dqy (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - - - - - - vcvttps2dq %xmm0, %xmm2 diff --git a/llvm/test/tools/llvm-mca/X86/Haswell/resources-avx1.s b/llvm/test/tools/llvm-mca/X86/Haswell/resources-avx1.s index 997ea61..6146a20 100644 --- a/llvm/test/tools/llvm-mca/X86/Haswell/resources-avx1.s +++ b/llvm/test/tools/llvm-mca/X86/Haswell/resources-avx1.s @@ -1123,11 +1123,11 @@ vzeroupper # CHECK-NEXT: 1 3 1.00 vcvtdq2ps %ymm0, %ymm2 # CHECK-NEXT: 2 10 1.00 * vcvtdq2ps (%rax), %ymm2 # CHECK-NEXT: 2 4 1.00 vcvtpd2dq %xmm0, %xmm2 -# CHECK-NEXT: 2 8 1.00 * vcvtpd2dqx (%rax), %xmm2 +# CHECK-NEXT: 3 10 1.00 * vcvtpd2dqx (%rax), %xmm2 # CHECK-NEXT: 2 6 1.00 vcvtpd2dq %ymm0, %xmm2 # CHECK-NEXT: 2 8 1.00 * vcvtpd2dqy (%rax), %xmm2 # CHECK-NEXT: 2 4 1.00 vcvtpd2ps %xmm0, %xmm2 -# CHECK-NEXT: 2 8 1.00 * vcvtpd2psx (%rax), %xmm2 +# CHECK-NEXT: 3 10 1.00 * vcvtpd2psx (%rax), %xmm2 # CHECK-NEXT: 2 6 1.00 vcvtpd2ps %ymm0, %xmm2 # CHECK-NEXT: 2 8 1.00 * vcvtpd2psy (%rax), %xmm2 # CHECK-NEXT: 1 3 1.00 vcvtps2dq %xmm0, %xmm2 @@ -1159,7 +1159,7 @@ vzeroupper # CHECK-NEXT: 3 9 1.00 * vcvtss2si (%rax), %ecx # CHECK-NEXT: 3 9 1.00 * vcvtss2si (%rax), %rcx # CHECK-NEXT: 2 4 1.00 vcvttpd2dq %xmm0, %xmm2 -# CHECK-NEXT: 2 8 1.00 * vcvttpd2dqx (%rax), %xmm2 +# CHECK-NEXT: 3 10 1.00 * vcvttpd2dqx (%rax), %xmm2 # CHECK-NEXT: 2 6 1.00 vcvttpd2dq %ymm0, %xmm2 # CHECK-NEXT: 2 8 1.00 * vcvttpd2dqy (%rax), %xmm2 # CHECK-NEXT: 1 3 1.00 vcvttps2dq %xmm0, %xmm2 @@ -1736,7 +1736,7 @@ vzeroupper # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] -# CHECK-NEXT: - 336.00 214.58 236.58 176.17 176.17 38.00 429.58 2.25 12.67 +# CHECK-NEXT: - 336.00 214.58 236.58 176.17 176.17 38.00 432.58 2.25 12.67 # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] Instructions: @@ -1833,11 +1833,11 @@ vzeroupper # CHECK-NEXT: - - - 1.00 - - - - - - vcvtdq2ps %ymm0, %ymm2 # CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvtdq2ps (%rax), %ymm2 # CHECK-NEXT: - - - 1.00 - - - 1.00 - - vcvtpd2dq %xmm0, %xmm2 -# CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvtpd2dqx (%rax), %xmm2 +# CHECK-NEXT: - - - 1.00 0.50 0.50 - 1.00 - - vcvtpd2dqx (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - - - 1.00 - - vcvtpd2dq %ymm0, %xmm2 # CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvtpd2dqy (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - - - 1.00 - - vcvtpd2ps %xmm0, %xmm2 -# CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvtpd2psx (%rax), %xmm2 +# CHECK-NEXT: - - - 1.00 0.50 0.50 - 1.00 - - vcvtpd2psx (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - - - 1.00 - - vcvtpd2ps %ymm0, %xmm2 # CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvtpd2psy (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - - - - - - vcvtps2dq %xmm0, %xmm2 @@ -1869,7 +1869,7 @@ vzeroupper # CHECK-NEXT: - - 1.00 1.00 0.50 0.50 - - - - vcvtss2si (%rax), %ecx # CHECK-NEXT: - - 1.00 1.00 0.50 0.50 - - - - vcvtss2si (%rax), %rcx # CHECK-NEXT: - - - 1.00 - - - 1.00 - - vcvttpd2dq %xmm0, %xmm2 -# CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvttpd2dqx (%rax), %xmm2 +# CHECK-NEXT: - - - 1.00 0.50 0.50 - 1.00 - - vcvttpd2dqx (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - - - 1.00 - - vcvttpd2dq %ymm0, %xmm2 # CHECK-NEXT: - - - 1.00 0.50 0.50 - - - - vcvttpd2dqy (%rax), %xmm2 # CHECK-NEXT: - - - 1.00 - - - - - - vcvttps2dq %xmm0, %xmm2 -- 2.7.4