diff --git a/llvm/lib/Target/X86/X86ScheduleZnver3.td b/llvm/lib/Target/X86/X86ScheduleZnver3.td index 19734565af9a..770cdc25df82 100644 --- a/llvm/lib/Target/X86/X86ScheduleZnver3.td +++ b/llvm/lib/Target/X86/X86ScheduleZnver3.td @@ -1542,7 +1542,8 @@ def Zn3WriteFZeroIdiomY : SchedWriteVariant<[ SchedVar, [Zn3WriteZeroLatency]>, SchedVar ]>; -def : InstRW<[Zn3WriteFZeroIdiomY], (instrs VXORPSYrr, VXORPDYrr)>; +def : InstRW<[Zn3WriteFZeroIdiomY], (instrs VXORPSYrr, VXORPDYrr, + VANDNPSYrr)>; def : IsZeroIdiomFunction<[ // GPR Zero-idioms. @@ -1560,7 +1561,8 @@ def : IsZeroIdiomFunction<[ VANDNPSrr ], ZeroIdiomPredicate>, // AVX YMM Zero-idioms. - DepBreakingClass<[ VXORPSYrr, VXORPDYrr ], ZeroIdiomPredicate>, + DepBreakingClass<[ VXORPSYrr, VXORPDYrr, + VANDNPSYrr ], ZeroIdiomPredicate>, ]>; def : IsDepBreakingFunction<[ diff --git a/llvm/test/tools/llvm-mca/X86/Znver3/zero-idioms-avx-ymm.s b/llvm/test/tools/llvm-mca/X86/Znver3/zero-idioms-avx-ymm.s index 0c8f1a7c4295..ac461bf877c6 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver3/zero-idioms-avx-ymm.s +++ b/llvm/test/tools/llvm-mca/X86/Znver3/zero-idioms-avx-ymm.s @@ -202,13 +202,13 @@ vandnps %ymm1, %ymm0, %ymm0 # CHECK: Iterations: 10000 # CHECK-NEXT: Instructions: 20000 -# CHECK-NEXT: Total Cycles: 20003 +# CHECK-NEXT: Total Cycles: 3337 # CHECK-NEXT: Total uOps: 20000 # CHECK: Dispatch Width: 6 -# CHECK-NEXT: uOps Per Cycle: 1.00 -# CHECK-NEXT: IPC: 1.00 -# CHECK-NEXT: Block RThroughput: 0.5 +# CHECK-NEXT: uOps Per Cycle: 5.99 +# CHECK-NEXT: IPC: 5.99 +# CHECK-NEXT: Block RThroughput: 0.3 # CHECK: Instruction Info: # CHECK-NEXT: [1]: #uOps @@ -219,17 +219,17 @@ vandnps %ymm1, %ymm0, %ymm0 # CHECK-NEXT: [6]: HasSideEffects (U) # CHECK: [1] [2] [3] [4] [5] [6] Instructions: -# CHECK-NEXT: 1 1 0.25 vandnps %ymm0, %ymm0, %ymm0 +# CHECK-NEXT: 1 0 0.17 vandnps %ymm0, %ymm0, %ymm0 # CHECK-NEXT: 1 1 0.25 vandnps %ymm1, %ymm0, %ymm0 # CHECK: Register File statistics: -# CHECK-NEXT: Total number of mappings created: 20000 -# CHECK-NEXT: Max number of mappings used: 66 +# CHECK-NEXT: Total number of mappings created: 10000 +# CHECK-NEXT: Max number of mappings used: 9 # CHECK: * Register File #1 -- Zn3FpPRF: # CHECK-NEXT: Number of physical registers: 160 -# CHECK-NEXT: Total number of mappings created: 20000 -# CHECK-NEXT: Max number of mappings used: 66 +# CHECK-NEXT: Total number of mappings created: 10000 +# CHECK-NEXT: Max number of mappings used: 9 # CHECK: * Register File #2 -- Zn3IntegerPRF: # CHECK-NEXT: Number of physical registers: 192 @@ -263,20 +263,20 @@ vandnps %ymm1, %ymm0, %ymm0 # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12.0] [12.1] [13] [14.0] [14.1] [14.2] [15.0] [15.1] [15.2] [16.0] [16.1] -# CHECK-NEXT: - - - - - - - - 0.50 0.50 0.50 0.50 - - - - - - - - - - - +# CHECK-NEXT: - - - - - - - - 0.25 0.25 0.25 0.25 - - - - - - - - - - - # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12.0] [12.1] [13] [14.0] [14.1] [14.2] [15.0] [15.1] [15.2] [16.0] [16.1] Instructions: -# CHECK-NEXT: - - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - vandnps %ymm0, %ymm0, %ymm0 -# CHECK-NEXT: - - - - - - - - 0.50 - 0.50 - - - - - - - - - - - - vandnps %ymm1, %ymm0, %ymm0 +# CHECK-NEXT: - - - - - - - - - - - - - - - - - - - - - - - vandnps %ymm0, %ymm0, %ymm0 +# CHECK-NEXT: - - - - - - - - 0.25 0.25 0.25 0.25 - - - - - - - - - - - vandnps %ymm1, %ymm0, %ymm0 # CHECK: Timeline view: -# CHECK-NEXT: Index 0123456 +# CHECK-NEXT: Index 0123 -# CHECK: [0,0] DeER .. vandnps %ymm0, %ymm0, %ymm0 -# CHECK-NEXT: [0,1] D=eER.. vandnps %ymm1, %ymm0, %ymm0 -# CHECK-NEXT: [1,0] D==eER. vandnps %ymm0, %ymm0, %ymm0 -# CHECK-NEXT: [1,1] D===eER vandnps %ymm1, %ymm0, %ymm0 +# CHECK: [0,0] DR . vandnps %ymm0, %ymm0, %ymm0 +# CHECK-NEXT: [0,1] DeER vandnps %ymm1, %ymm0, %ymm0 +# CHECK-NEXT: [1,0] D--R vandnps %ymm0, %ymm0, %ymm0 +# CHECK-NEXT: [1,1] DeER vandnps %ymm1, %ymm0, %ymm0 # CHECK: Average Wait times (based on the timeline view): # CHECK-NEXT: [0]: Executions @@ -285,6 +285,6 @@ vandnps %ymm1, %ymm0, %ymm0 # CHECK-NEXT: [3]: Average time elapsed from WB until retire stage # CHECK: [0] [1] [2] [3] -# CHECK-NEXT: 0. 2 2.0 0.5 0.0 vandnps %ymm0, %ymm0, %ymm0 -# CHECK-NEXT: 1. 2 3.0 0.0 0.0 vandnps %ymm1, %ymm0, %ymm0 -# CHECK-NEXT: 2 2.5 0.3 0.0 +# CHECK-NEXT: 0. 2 0.0 0.0 1.0 vandnps %ymm0, %ymm0, %ymm0 +# CHECK-NEXT: 1. 2 1.0 1.0 0.0 vandnps %ymm1, %ymm0, %ymm0 +# CHECK-NEXT: 2 0.5 0.5 0.5