From: Simon Pilgrim Date: Thu, 3 May 2018 22:12:23 +0000 (+0000) Subject: [X86][Znver1] Use SchedAlias to tag microcoded scheduler classes X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0aed731516d0941846ee128ab6ac680de73f1457;p=platform%2Fupstream%2Fllvm.git [X86][Znver1] Use SchedAlias to tag microcoded scheduler classes Avoids extra entries in the class tables. Found a typo that missed the MMX_PHSUBSW instruction. llvm-svn: 331488 --- diff --git a/llvm/lib/Target/X86/X86ScheduleZnver1.td b/llvm/lib/Target/X86/X86ScheduleZnver1.td index 8c4c960..a6ba4cb 100644 --- a/llvm/lib/Target/X86/X86ScheduleZnver1.td +++ b/llvm/lib/Target/X86/X86ScheduleZnver1.td @@ -191,8 +191,6 @@ def : WriteRes; def : WriteRes; def : WriteRes { let Latency = 8; } -defm : ZnWriteResFpuPair; -defm : ZnWriteResFpuPair; defm : ZnWriteResFpuPair; defm : ZnWriteResFpuPair; defm : ZnWriteResFpuPair; @@ -241,8 +239,6 @@ defm : ZnWriteResFpuPair; defm : ZnWriteResFpuPair; defm : ZnWriteResFpuPair; defm : ZnWriteResFpuPair; -defm : ZnWriteResFpuPair; -defm : ZnWriteResFpuPair; defm : ZnWriteResFpuPair; defm : ZnWriteResFpuPair; defm : ZnWriteResFpuPair; @@ -297,26 +293,28 @@ defm : ZnWriteResFpuPair; defm : ZnWriteResFpuPair; // Microcoded Instructions -let Latency = 100 in { - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - def : WriteRes; - } +def ZnWriteMicrocoded : SchedWriteRes<[]> { + let Latency = 100; +} + +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; //=== Regex based InstRW ===// // Notation: @@ -1028,13 +1026,10 @@ def : InstRW<[WriteMicrocoded], (instregex "VPGATHER(Q|D)(Q|D)(Y?)rm")>; // HADD, HSUB PS/PD // PHADD|PHSUB (S) W/D. -def : InstRW<[WriteMicrocoded], (instregex "MMX_PHADD(W|D)r(r|m)", - "MMX_PHADDSWr(r|m)", - "MMX_PHSUB(W|D)r(r|m)", - "MMX_PHSUBSWrr", - "(V?)PH(ADD|SUB)(W|D)(Y?)r(r|m)", - "(V?)PH(ADD|SUB)SW(Y?)r(r|m)")>; - +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; // PCMPGTQ. def ZnWritePCMPGTQr : SchedWriteRes<[ZnFPU03]>; @@ -1452,7 +1447,10 @@ def : InstRW<[ZnWriteSHA256RNDS2Ld], (instregex "SHA256RNDS2rm")>; //-- Arithmetic instructions --// // HADD, HSUB PS/PD -def : InstRW<[WriteMicrocoded], (instregex "(V?)H(ADD|SUB)P(S|D)(Y?)r(r|m)")>; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; +def : SchedAlias; // MULL SS/SD PS/PD. // x,x / v,v,v. diff --git a/llvm/test/CodeGen/X86/mmx-schedule.ll b/llvm/test/CodeGen/X86/mmx-schedule.ll index 3556a79..b57a20d 100644 --- a/llvm/test/CodeGen/X86/mmx-schedule.ll +++ b/llvm/test/CodeGen/X86/mmx-schedule.ll @@ -3409,7 +3409,7 @@ define i64 @test_phsubsw(x86_mmx %a0, x86_mmx %a1, x86_mmx* %a2) optsize { ; ZNVER1-LABEL: test_phsubsw: ; ZNVER1: # %bb.0: ; ZNVER1-NEXT: phsubsw %mm1, %mm0 # sched: [100:?] -; ZNVER1-NEXT: phsubsw (%rdi), %mm0 # sched: [8:0.50] +; ZNVER1-NEXT: phsubsw (%rdi), %mm0 # sched: [100:?] ; ZNVER1-NEXT: movq %mm0, %rax # sched: [2:1.00] ; ZNVER1-NEXT: retq # sched: [1:0.50] %1 = call x86_mmx @llvm.x86.ssse3.phsub.sw(x86_mmx %a0, x86_mmx %a1) diff --git a/llvm/test/tools/llvm-mca/X86/Znver1/resources-ssse3.s b/llvm/test/tools/llvm-mca/X86/Znver1/resources-ssse3.s index 95c1618..1e1f955 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver1/resources-ssse3.s +++ b/llvm/test/tools/llvm-mca/X86/Znver1/resources-ssse3.s @@ -139,7 +139,7 @@ psignw (%rax), %xmm2 # CHECK-NEXT: 1 100 - phsubd %xmm0, %xmm2 # CHECK-NEXT: 1 100 - * phsubd (%rax), %xmm2 # CHECK-NEXT: 1 100 - phsubsw %mm0, %mm2 -# CHECK-NEXT: 1 8 0.50 * phsubsw (%rax), %mm2 +# CHECK-NEXT: 1 100 - * phsubsw (%rax), %mm2 # CHECK-NEXT: 1 100 - phsubsw %xmm0, %xmm2 # CHECK-NEXT: 1 100 - * phsubsw (%rax), %xmm2 # CHECK-NEXT: 1 100 - phsubw %mm0, %mm2 @@ -187,7 +187,7 @@ psignw (%rax), %xmm2 # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] -# CHECK-NEXT: 10.50 10.50 - - - - - 16.25 8.25 8.25 8.25 - +# CHECK-NEXT: 10.00 10.00 - - - - - 16.00 8.00 8.00 8.00 - # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] Instructions: @@ -224,7 +224,7 @@ psignw (%rax), %xmm2 # CHECK-NEXT: - - - - - - - - - - - - phsubd %xmm0, %xmm2 # CHECK-NEXT: - - - - - - - - - - - - phsubd (%rax), %xmm2 # CHECK-NEXT: - - - - - - - - - - - - phsubsw %mm0, %mm2 -# CHECK-NEXT: 0.50 0.50 - - - - - 0.25 0.25 0.25 0.25 - phsubsw (%rax), %mm2 +# CHECK-NEXT: - - - - - - - - - - - - phsubsw (%rax), %mm2 # CHECK-NEXT: - - - - - - - - - - - - phsubsw %xmm0, %xmm2 # CHECK-NEXT: - - - - - - - - - - - - phsubsw (%rax), %xmm2 # CHECK-NEXT: - - - - - - - - - - - - phsubw %mm0, %mm2