Index: test/tools/llvm-mca/X86/BtVer2/partial-reg-update-2.s =================================================================== --- test/tools/llvm-mca/X86/BtVer2/partial-reg-update-2.s +++ test/tools/llvm-mca/X86/BtVer2/partial-reg-update-2.s @@ -1,3 +1,4 @@ +# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py # RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -iterations=1 -resource-pressure=false -timeline < %s | FileCheck %s imul %rax, %rbx Index: test/tools/llvm-mca/X86/option-all-stats-1.s =================================================================== --- test/tools/llvm-mca/X86/option-all-stats-1.s +++ test/tools/llvm-mca/X86/option-all-stats-1.s @@ -1,92 +1,116 @@ # NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-stats < %s | FileCheck %s -check-prefix=ALL -check-prefix=FULLREPORT -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-stats=true < %s | FileCheck %s -check-prefix=ALL -check-prefix=FULLREPORT -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-stats=false < %s | FileCheck %s -check-prefix=ALL -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 < %s | FileCheck %s -check-prefix=ALL +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-stats < %s | FileCheck %s -check-prefixes=ALL,SUMMARY,STATS +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-stats=true < %s | FileCheck %s -check-prefixes=ALL,SUMMARY,STATS +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-stats=false < %s | FileCheck %s -check-prefixes=ALL,NOSTATS +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 < %s | FileCheck %s -check-prefixes=ALL,SUMMARY,NOSTATS add %eax, %eax -# FULLREPORT: Iterations: 100 -# FULLREPORT-NEXT: Instructions: 100 -# FULLREPORT-NEXT: Total Cycles: 103 -# FULLREPORT-NEXT: Dispatch Width: 2 -# FULLREPORT-NEXT: IPC: 0.97 -# FULLREPORT-NEXT: Block RThroughput: 0.5 - -# ALL: Instruction Info: -# ALL-NEXT: [1]: #uOps -# ALL-NEXT: [2]: Latency -# ALL-NEXT: [3]: RThroughput -# ALL-NEXT: [4]: MayLoad -# ALL-NEXT: [5]: MayStore -# ALL-NEXT: [6]: HasSideEffects - -# ALL: [1] [2] [3] [4] [5] [6] Instructions: -# ALL-NEXT: 1 1 0.50 addl %eax, %eax - -# FULLREPORT: Dynamic Dispatch Stall Cycles: -# FULLREPORT-NEXT: RAT - Register unavailable: 0 -# FULLREPORT-NEXT: RCU - Retire tokens unavailable: 0 -# FULLREPORT-NEXT: SCHEDQ - Scheduler full: 61 -# FULLREPORT-NEXT: LQ - Load queue full: 0 -# FULLREPORT-NEXT: SQ - Store queue full: 0 -# FULLREPORT-NEXT: GROUP - Static restrictions on the dispatch group: 0 - -# FULLREPORT: Dispatch Logic - number of cycles where we saw N instructions dispatched: -# FULLREPORT-NEXT: [# dispatched], [# cycles] -# FULLREPORT-NEXT: 0, 22 (21.4%) -# FULLREPORT-NEXT: 2, 19 (18.4%) -# FULLREPORT-NEXT: 1, 62 (60.2%) - -# FULLREPORT: Schedulers - number of cycles where we saw N instructions issued: -# FULLREPORT-NEXT: [# issued], [# cycles] -# FULLREPORT-NEXT: 0, 3 (2.9%) -# FULLREPORT-NEXT: 1, 100 (97.1%) - -# FULLREPORT: Scheduler's queue usage: -# FULLREPORT-NEXT: JALU01, 20/20 -# FULLREPORT-NEXT: JFPU01, 0/18 -# FULLREPORT-NEXT: JLSAGU, 0/12 - -# FULLREPORT: Retire Control Unit - number of cycles where we saw N instructions retired: -# FULLREPORT-NEXT: [# retired], [# cycles] -# FULLREPORT-NEXT: 0, 3 (2.9%) -# FULLREPORT-NEXT: 1, 100 (97.1%) - -# FULLREPORT: Register File statistics: -# FULLREPORT-NEXT: Total number of mappings created: 200 -# FULLREPORT-NEXT: Max number of mappings used: 44 - -# FULLREPORT: * Register File #1 -- JFpuPRF: -# FULLREPORT-NEXT: Number of physical registers: 72 -# FULLREPORT-NEXT: Total number of mappings created: 0 -# FULLREPORT-NEXT: Max number of mappings used: 0 - -# FULLREPORT: * Register File #2 -- JIntegerPRF: -# FULLREPORT-NEXT: Number of physical registers: 64 -# FULLREPORT-NEXT: Total number of mappings created: 200 -# FULLREPORT-NEXT: Max number of mappings used: 44 - -# FULLREPORT: Resources: -# FULLREPORT-NEXT: [0] - JALU0 -# FULLREPORT-NEXT: [1] - JALU1 -# FULLREPORT-NEXT: [2] - JDiv -# FULLREPORT-NEXT: [3] - JFPA -# FULLREPORT-NEXT: [4] - JFPM -# FULLREPORT-NEXT: [5] - JFPU0 -# FULLREPORT-NEXT: [6] - JFPU1 -# FULLREPORT-NEXT: [7] - JLAGU -# FULLREPORT-NEXT: [8] - JMul -# FULLREPORT-NEXT: [9] - JSAGU -# FULLREPORT-NEXT: [10] - JSTC -# FULLREPORT-NEXT: [11] - JVALU0 -# FULLREPORT-NEXT: [12] - JVALU1 -# FULLREPORT-NEXT: [13] - JVIMUL - -# FULLREPORT: Resource pressure per iteration: -# FULLREPORT-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] -# FULLREPORT-NEXT: 0.50 0.50 - - - - - - - - - - - - - -# FULLREPORT: Resource pressure by instruction: -# FULLREPORT-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] Instructions: -# FULLREPORT-NEXT: 0.50 0.50 - - - - - - - - - - - - addl %eax, %eax +# SUMMARY: Iterations: 100 +# SUMMARY-NEXT: Instructions: 100 +# SUMMARY-NEXT: Total Cycles: 103 +# SUMMARY-NEXT: Dispatch Width: 2 +# SUMMARY-NEXT: IPC: 0.97 +# SUMMARY-NEXT: Block RThroughput: 0.5 + +# ALL: Instruction Info: +# ALL-NEXT: [1]: #uOps +# ALL-NEXT: [2]: Latency +# ALL-NEXT: [3]: RThroughput +# ALL-NEXT: [4]: MayLoad +# ALL-NEXT: [5]: MayStore +# ALL-NEXT: [6]: HasSideEffects + +# ALL: [1] [2] [3] [4] [5] [6] Instructions: +# ALL-NEXT: 1 1 0.50 addl %eax, %eax + +# STATS: Dynamic Dispatch Stall Cycles: +# STATS-NEXT: RAT - Register unavailable: 0 +# STATS-NEXT: RCU - Retire tokens unavailable: 0 +# STATS-NEXT: SCHEDQ - Scheduler full: 61 +# STATS-NEXT: LQ - Load queue full: 0 +# STATS-NEXT: SQ - Store queue full: 0 +# STATS-NEXT: GROUP - Static restrictions on the dispatch group: 0 + +# NOSTATS: Resources: +# NOSTATS-NEXT: [0] - JALU0 +# NOSTATS-NEXT: [1] - JALU1 +# NOSTATS-NEXT: [2] - JDiv +# NOSTATS-NEXT: [3] - JFPA +# NOSTATS-NEXT: [4] - JFPM +# NOSTATS-NEXT: [5] - JFPU0 +# NOSTATS-NEXT: [6] - JFPU1 +# NOSTATS-NEXT: [7] - JLAGU +# NOSTATS-NEXT: [8] - JMul +# NOSTATS-NEXT: [9] - JSAGU +# NOSTATS-NEXT: [10] - JSTC +# NOSTATS-NEXT: [11] - JVALU0 +# NOSTATS-NEXT: [12] - JVALU1 +# NOSTATS-NEXT: [13] - JVIMUL + +# STATS: Dispatch Logic - number of cycles where we saw N instructions dispatched: +# STATS-NEXT: [# dispatched], [# cycles] +# STATS-NEXT: 0, 22 (21.4%) +# STATS-NEXT: 2, 19 (18.4%) +# STATS-NEXT: 1, 62 (60.2%) + +# NOSTATS: Resource pressure per iteration: +# NOSTATS-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] +# NOSTATS-NEXT: 0.50 0.50 - - - - - - - - - - - - + +# NOSTATS: Resource pressure by instruction: +# NOSTATS-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] Instructions: +# NOSTATS-NEXT: 0.50 0.50 - - - - - - - - - - - - addl %eax, %eax + +# STATS: Schedulers - number of cycles where we saw N instructions issued: +# STATS-NEXT: [# issued], [# cycles] +# STATS-NEXT: 0, 3 (2.9%) +# STATS-NEXT: 1, 100 (97.1%) + +# STATS: Scheduler's queue usage: +# STATS-NEXT: JALU01, 20/20 +# STATS-NEXT: JFPU01, 0/18 +# STATS-NEXT: JLSAGU, 0/12 + +# STATS: Retire Control Unit - number of cycles where we saw N instructions retired: +# STATS-NEXT: [# retired], [# cycles] +# STATS-NEXT: 0, 3 (2.9%) +# STATS-NEXT: 1, 100 (97.1%) + +# STATS: Register File statistics: +# STATS-NEXT: Total number of mappings created: 200 +# STATS-NEXT: Max number of mappings used: 44 + +# STATS: * Register File #1 -- JFpuPRF: +# STATS-NEXT: Number of physical registers: 72 +# STATS-NEXT: Total number of mappings created: 0 +# STATS-NEXT: Max number of mappings used: 0 + +# STATS: * Register File #2 -- JIntegerPRF: +# STATS-NEXT: Number of physical registers: 64 +# STATS-NEXT: Total number of mappings created: 200 +# STATS-NEXT: Max number of mappings used: 44 + +# STATS: Resources: +# STATS-NEXT: [0] - JALU0 +# STATS-NEXT: [1] - JALU1 +# STATS-NEXT: [2] - JDiv +# STATS-NEXT: [3] - JFPA +# STATS-NEXT: [4] - JFPM +# STATS-NEXT: [5] - JFPU0 +# STATS-NEXT: [6] - JFPU1 +# STATS-NEXT: [7] - JLAGU +# STATS-NEXT: [8] - JMul +# STATS-NEXT: [9] - JSAGU +# STATS-NEXT: [10] - JSTC +# STATS-NEXT: [11] - JVALU0 +# STATS-NEXT: [12] - JVALU1 +# STATS-NEXT: [13] - JVIMUL + +# STATS: Resource pressure per iteration: +# STATS-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] +# STATS-NEXT: 0.50 0.50 - - - - - - - - - - - - + +# STATS: Resource pressure by instruction: +# STATS-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] Instructions: +# STATS-NEXT: 0.50 0.50 - - - - - - - - - - - - addl %eax, %eax Index: test/tools/llvm-mca/X86/option-all-stats-2.s =================================================================== --- test/tools/llvm-mca/X86/option-all-stats-2.s +++ test/tools/llvm-mca/X86/option-all-stats-2.s @@ -1,93 +1,146 @@ # NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-stats -dispatch-stats=false < %s | FileCheck %s -check-prefix=ALL -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-stats < %s | FileCheck %s -check-prefix=ALL -check-prefix=FULL -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-stats -dispatch-stats < %s | FileCheck %s -check-prefix=ALL -check-prefix=FULL -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -dispatch-stats -all-stats < %s | FileCheck %s -check-prefix=ALL -check-prefix=FULL -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -dispatch-stats=false -all-stats < %s | FileCheck %s -check-prefix=ALL -check-prefix=FULL +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-stats -dispatch-stats=false < %s | FileCheck %s -check-prefixes=ALL,NODISPATCH +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-stats < %s | FileCheck %s -check-prefixes=ALL,DISPATCH +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-stats -dispatch-stats < %s | FileCheck %s -check-prefixes=ALL,DISPATCH +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -dispatch-stats -all-stats < %s | FileCheck %s -check-prefixes=ALL,DISPATCH +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -dispatch-stats=false -all-stats < %s | FileCheck %s -check-prefixes=ALL,DISPATCH add %eax, %eax -# ALL: Iterations: 100 -# ALL-NEXT: Instructions: 100 -# ALL-NEXT: Total Cycles: 103 -# ALL-NEXT: Dispatch Width: 2 -# ALL-NEXT: IPC: 0.97 -# ALL-NEXT: Block RThroughput: 0.5 - -# ALL: Instruction Info: -# ALL-NEXT: [1]: #uOps -# ALL-NEXT: [2]: Latency -# ALL-NEXT: [3]: RThroughput -# ALL-NEXT: [4]: MayLoad -# ALL-NEXT: [5]: MayStore -# ALL-NEXT: [6]: HasSideEffects - -# ALL: [1] [2] [3] [4] [5] [6] Instructions: -# ALL-NEXT: 1 1 0.50 addl %eax, %eax - -# FULL: Dynamic Dispatch Stall Cycles: -# FULL-NEXT: RAT - Register unavailable: 0 -# FULL-NEXT: RCU - Retire tokens unavailable: 0 -# FULL-NEXT: SCHEDQ - Scheduler full: 61 -# FULL-NEXT: LQ - Load queue full: 0 -# FULL-NEXT: SQ - Store queue full: 0 -# FULL-NEXT: GROUP - Static restrictions on the dispatch group: 0 - -# FULL: Dispatch Logic - number of cycles where we saw N instructions dispatched: -# FULL-NEXT: [# dispatched], [# cycles] -# FULL-NEXT: 0, 22 (21.4%) -# FULL-NEXT: 2, 19 (18.4%) -# FULL-NEXT: 1, 62 (60.2%) - -# FULL: Schedulers - number of cycles where we saw N instructions issued: -# FULL-NEXT: [# issued], [# cycles] -# FULL-NEXT: 0, 3 (2.9%) -# FULL-NEXT: 1, 100 (97.1%) - -# FULL: Scheduler's queue usage: -# FULL-NEXT: JALU01, 20/20 -# FULL-NEXT: JFPU01, 0/18 -# FULL-NEXT: JLSAGU, 0/12 - -# FULL: Retire Control Unit - number of cycles where we saw N instructions retired: -# FULL-NEXT: [# retired], [# cycles] -# FULL-NEXT: 0, 3 (2.9%) -# FULL-NEXT: 1, 100 (97.1%) - -# FULL: Register File statistics: -# FULL-NEXT: Total number of mappings created: 200 -# FULL-NEXT: Max number of mappings used: 44 - -# FULL: * Register File #1 -- JFpuPRF: -# FULL-NEXT: Number of physical registers: 72 -# FULL-NEXT: Total number of mappings created: 0 -# FULL-NEXT: Max number of mappings used: 0 - -# FULL: * Register File #2 -- JIntegerPRF: -# FULL-NEXT: Number of physical registers: 64 -# FULL-NEXT: Total number of mappings created: 200 -# FULL-NEXT: Max number of mappings used: 44 - -# FULL: Resources: -# FULL-NEXT: [0] - JALU0 -# FULL-NEXT: [1] - JALU1 -# FULL-NEXT: [2] - JDiv -# FULL-NEXT: [3] - JFPA -# FULL-NEXT: [4] - JFPM -# FULL-NEXT: [5] - JFPU0 -# FULL-NEXT: [6] - JFPU1 -# FULL-NEXT: [7] - JLAGU -# FULL-NEXT: [8] - JMul -# FULL-NEXT: [9] - JSAGU -# FULL-NEXT: [10] - JSTC -# FULL-NEXT: [11] - JVALU0 -# FULL-NEXT: [12] - JVALU1 -# FULL-NEXT: [13] - JVIMUL - -# FULL: Resource pressure per iteration: -# FULL-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] -# FULL-NEXT: 0.50 0.50 - - - - - - - - - - - - - -# FULL: Resource pressure by instruction: -# FULL-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] Instructions: -# FULL-NEXT: 0.50 0.50 - - - - - - - - - - - - addl %eax, %eax +# ALL: Iterations: 100 +# ALL-NEXT: Instructions: 100 +# ALL-NEXT: Total Cycles: 103 +# ALL-NEXT: Dispatch Width: 2 +# ALL-NEXT: IPC: 0.97 +# ALL-NEXT: Block RThroughput: 0.5 + +# ALL: Instruction Info: +# ALL-NEXT: [1]: #uOps +# ALL-NEXT: [2]: Latency +# ALL-NEXT: [3]: RThroughput +# ALL-NEXT: [4]: MayLoad +# ALL-NEXT: [5]: MayStore +# ALL-NEXT: [6]: HasSideEffects + +# ALL: [1] [2] [3] [4] [5] [6] Instructions: +# ALL-NEXT: 1 1 0.50 addl %eax, %eax + +# DISPATCH: Dynamic Dispatch Stall Cycles: +# DISPATCH-NEXT: RAT - Register unavailable: 0 +# DISPATCH-NEXT: RCU - Retire tokens unavailable: 0 +# DISPATCH-NEXT: SCHEDQ - Scheduler full: 61 +# DISPATCH-NEXT: LQ - Load queue full: 0 +# DISPATCH-NEXT: SQ - Store queue full: 0 +# DISPATCH-NEXT: GROUP - Static restrictions on the dispatch group: 0 + +# NODISPATCH: Schedulers - number of cycles where we saw N instructions issued: +# NODISPATCH-NEXT: [# issued], [# cycles] +# NODISPATCH-NEXT: 0, 3 (2.9%) +# NODISPATCH-NEXT: 1, 100 (97.1%) + +# DISPATCH: Dispatch Logic - number of cycles where we saw N instructions dispatched: +# DISPATCH-NEXT: [# dispatched], [# cycles] +# DISPATCH-NEXT: 0, 22 (21.4%) +# DISPATCH-NEXT: 2, 19 (18.4%) +# DISPATCH-NEXT: 1, 62 (60.2%) + +# NODISPATCH: Scheduler's queue usage: +# NODISPATCH-NEXT: JALU01, 20/20 +# NODISPATCH-NEXT: JFPU01, 0/18 +# NODISPATCH-NEXT: JLSAGU, 0/12 + +# NODISPATCH: Retire Control Unit - number of cycles where we saw N instructions retired: +# NODISPATCH-NEXT: [# retired], [# cycles] +# NODISPATCH-NEXT: 0, 3 (2.9%) +# NODISPATCH-NEXT: 1, 100 (97.1%) + +# DISPATCH: Schedulers - number of cycles where we saw N instructions issued: +# DISPATCH-NEXT: [# issued], [# cycles] +# DISPATCH-NEXT: 0, 3 (2.9%) +# DISPATCH-NEXT: 1, 100 (97.1%) + +# NODISPATCH: Register File statistics: +# NODISPATCH-NEXT: Total number of mappings created: 200 +# NODISPATCH-NEXT: Max number of mappings used: 44 + +# DISPATCH: Scheduler's queue usage: +# DISPATCH-NEXT: JALU01, 20/20 +# DISPATCH-NEXT: JFPU01, 0/18 +# DISPATCH-NEXT: JLSAGU, 0/12 + +# NODISPATCH: * Register File #1 -- JFpuPRF: +# NODISPATCH-NEXT: Number of physical registers: 72 +# NODISPATCH-NEXT: Total number of mappings created: 0 +# NODISPATCH-NEXT: Max number of mappings used: 0 + +# DISPATCH: Retire Control Unit - number of cycles where we saw N instructions retired: +# DISPATCH-NEXT: [# retired], [# cycles] +# DISPATCH-NEXT: 0, 3 (2.9%) +# DISPATCH-NEXT: 1, 100 (97.1%) + +# NODISPATCH: * Register File #2 -- JIntegerPRF: +# NODISPATCH-NEXT: Number of physical registers: 64 +# NODISPATCH-NEXT: Total number of mappings created: 200 +# NODISPATCH-NEXT: Max number of mappings used: 44 + +# DISPATCH: Register File statistics: +# DISPATCH-NEXT: Total number of mappings created: 200 +# DISPATCH-NEXT: Max number of mappings used: 44 + +# DISPATCH: * Register File #1 -- JFpuPRF: +# DISPATCH-NEXT: Number of physical registers: 72 +# DISPATCH-NEXT: Total number of mappings created: 0 +# DISPATCH-NEXT: Max number of mappings used: 0 + +# NODISPATCH: Resources: +# NODISPATCH-NEXT: [0] - JALU0 +# NODISPATCH-NEXT: [1] - JALU1 +# NODISPATCH-NEXT: [2] - JDiv +# NODISPATCH-NEXT: [3] - JFPA +# NODISPATCH-NEXT: [4] - JFPM +# NODISPATCH-NEXT: [5] - JFPU0 +# NODISPATCH-NEXT: [6] - JFPU1 +# NODISPATCH-NEXT: [7] - JLAGU +# NODISPATCH-NEXT: [8] - JMul +# NODISPATCH-NEXT: [9] - JSAGU +# NODISPATCH-NEXT: [10] - JSTC +# NODISPATCH-NEXT: [11] - JVALU0 +# NODISPATCH-NEXT: [12] - JVALU1 +# NODISPATCH-NEXT: [13] - JVIMUL + +# DISPATCH: * Register File #2 -- JIntegerPRF: +# DISPATCH-NEXT: Number of physical registers: 64 +# DISPATCH-NEXT: Total number of mappings created: 200 +# DISPATCH-NEXT: Max number of mappings used: 44 + +# NODISPATCH: Resource pressure per iteration: +# NODISPATCH-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] +# NODISPATCH-NEXT: 0.50 0.50 - - - - - - - - - - - - + +# NODISPATCH: Resource pressure by instruction: +# NODISPATCH-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] Instructions: +# NODISPATCH-NEXT: 0.50 0.50 - - - - - - - - - - - - addl %eax, %eax + +# DISPATCH: Resources: +# DISPATCH-NEXT: [0] - JALU0 +# DISPATCH-NEXT: [1] - JALU1 +# DISPATCH-NEXT: [2] - JDiv +# DISPATCH-NEXT: [3] - JFPA +# DISPATCH-NEXT: [4] - JFPM +# DISPATCH-NEXT: [5] - JFPU0 +# DISPATCH-NEXT: [6] - JFPU1 +# DISPATCH-NEXT: [7] - JLAGU +# DISPATCH-NEXT: [8] - JMul +# DISPATCH-NEXT: [9] - JSAGU +# DISPATCH-NEXT: [10] - JSTC +# DISPATCH-NEXT: [11] - JVALU0 +# DISPATCH-NEXT: [12] - JVALU1 +# DISPATCH-NEXT: [13] - JVIMUL + +# DISPATCH: Resource pressure per iteration: +# DISPATCH-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] +# DISPATCH-NEXT: 0.50 0.50 - - - - - - - - - - - - + +# DISPATCH: Resource pressure by instruction: +# DISPATCH-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] Instructions: +# DISPATCH-NEXT: 0.50 0.50 - - - - - - - - - - - - addl %eax, %eax Index: test/tools/llvm-mca/X86/option-all-views-1.s =================================================================== --- test/tools/llvm-mca/X86/option-all-views-1.s +++ test/tools/llvm-mca/X86/option-all-views-1.s @@ -1,30 +1,30 @@ # NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-views < %s | FileCheck %s -check-prefix=DEFAULTREPORT -check-prefix=FULLREPORT -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-views=true < %s | FileCheck %s -check-prefix=DEFAULTREPORT -check-prefix=FULLREPORT -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-views=false < %s | FileCheck %s -check-prefix=NOREPORT -allow-empty -# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 < %s | FileCheck %s -check-prefix=DEFAULTREPORT +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-views < %s | FileCheck %s -check-prefixes=COMMON,FULLREPORT +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-views=true < %s | FileCheck %s -check-prefixes=COMMON,FULLREPORT +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -all-views=false < %s | FileCheck %s -check-prefixes=NOREPORT -allow-empty +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 < %s | FileCheck %s -check-prefixes=COMMON,DEFAULTREPORT add %eax, %eax # NOREPORT-NOT: {{.}} -# DEFAULTREPORT: Iterations: 100 -# DEFAULTREPORT-NEXT: Instructions: 100 -# DEFAULTREPORT-NEXT: Total Cycles: 103 -# DEFAULTREPORT-NEXT: Dispatch Width: 2 -# DEFAULTREPORT-NEXT: IPC: 0.97 -# DEFAULTREPORT-NEXT: Block RThroughput: 0.5 +# COMMON: Iterations: 100 +# COMMON-NEXT: Instructions: 100 +# COMMON-NEXT: Total Cycles: 103 +# COMMON-NEXT: Dispatch Width: 2 +# COMMON-NEXT: IPC: 0.97 +# COMMON-NEXT: Block RThroughput: 0.5 -# DEFAULTREPORT: Instruction Info: -# DEFAULTREPORT-NEXT: [1]: #uOps -# DEFAULTREPORT-NEXT: [2]: Latency -# DEFAULTREPORT-NEXT: [3]: RThroughput -# DEFAULTREPORT-NEXT: [4]: MayLoad -# DEFAULTREPORT-NEXT: [5]: MayStore -# DEFAULTREPORT-NEXT: [6]: HasSideEffects +# COMMON: Instruction Info: +# COMMON-NEXT: [1]: #uOps +# COMMON-NEXT: [2]: Latency +# COMMON-NEXT: [3]: RThroughput +# COMMON-NEXT: [4]: MayLoad +# COMMON-NEXT: [5]: MayStore +# COMMON-NEXT: [6]: HasSideEffects -# DEFAULTREPORT: [1] [2] [3] [4] [5] [6] Instructions: -# DEFAULTREPORT-NEXT: 1 1 0.50 addl %eax, %eax +# COMMON: [1] [2] [3] [4] [5] [6] Instructions: +# COMMON-NEXT: 1 1 0.50 addl %eax, %eax # FULLREPORT: Dynamic Dispatch Stall Cycles: # FULLREPORT-NEXT: RAT - Register unavailable: 0 @@ -34,12 +34,36 @@ # FULLREPORT-NEXT: SQ - Store queue full: 0 # FULLREPORT-NEXT: GROUP - Static restrictions on the dispatch group: 0 +# DEFAULTREPORT: Resources: +# DEFAULTREPORT-NEXT: [0] - JALU0 +# DEFAULTREPORT-NEXT: [1] - JALU1 +# DEFAULTREPORT-NEXT: [2] - JDiv +# DEFAULTREPORT-NEXT: [3] - JFPA +# DEFAULTREPORT-NEXT: [4] - JFPM +# DEFAULTREPORT-NEXT: [5] - JFPU0 +# DEFAULTREPORT-NEXT: [6] - JFPU1 +# DEFAULTREPORT-NEXT: [7] - JLAGU +# DEFAULTREPORT-NEXT: [8] - JMul +# DEFAULTREPORT-NEXT: [9] - JSAGU +# DEFAULTREPORT-NEXT: [10] - JSTC +# DEFAULTREPORT-NEXT: [11] - JVALU0 +# DEFAULTREPORT-NEXT: [12] - JVALU1 +# DEFAULTREPORT-NEXT: [13] - JVIMUL + # FULLREPORT: Dispatch Logic - number of cycles where we saw N instructions dispatched: # FULLREPORT-NEXT: [# dispatched], [# cycles] # FULLREPORT-NEXT: 0, 22 (21.4%) # FULLREPORT-NEXT: 2, 19 (18.4%) # FULLREPORT-NEXT: 1, 62 (60.2%) +# DEFAULTREPORT: Resource pressure per iteration: +# DEFAULTREPORT-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] +# DEFAULTREPORT-NEXT: 0.50 0.50 - - - - - - - - - - - - + +# DEFAULTREPORT: Resource pressure by instruction: +# DEFAULTREPORT-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] Instructions: +# DEFAULTREPORT-NEXT: 0.50 0.50 - - - - - - - - - - - - addl %eax, %eax + # FULLREPORT: Schedulers - number of cycles where we saw N instructions issued: # FULLREPORT-NEXT: [# issued], [# cycles] # FULLREPORT-NEXT: 0, 3 (2.9%) Index: test/tools/llvm-mca/X86/register-file-statistics.s =================================================================== --- test/tools/llvm-mca/X86/register-file-statistics.s +++ test/tools/llvm-mca/X86/register-file-statistics.s @@ -1,27 +1,27 @@ # NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py -# RUN: llvm-mca %s -mtriple=x86_64-unknown-unknown -mcpu=btver2 -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL,BTVER2 %s -# RUN: llvm-mca %s -mtriple=x86_64-unknown-unknown -mcpu=znver1 -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL,ZNVER1 %s -# RUN: llvm-mca %s -mtriple=x86_64-unknown-unknown -mcpu=sandybridge -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL,SNB %s -# RUN: llvm-mca %s -mtriple=x86_64-unknown-unknown -mcpu=ivybridge -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL,IVB %s -# RUN: llvm-mca %s -mtriple=x86_64-unknown-unknown -mcpu=haswell -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL,HSW %s -# RUN: llvm-mca %s -mtriple=x86_64-unknown-unknown -mcpu=broadwell -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL,BDW %s -# RUN: llvm-mca %s -mtriple=x86_64-unknown-unknown -mcpu=knl -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL,KNL %s -# RUN: llvm-mca %s -mtriple=x86_64-unknown-unknown -mcpu=skylake -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL,SKX %s -# RUN: llvm-mca %s -mtriple=x86_64-unknown-unknown -mcpu=skylake-avx512 -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL,SKX-AVX512 %s -# RUN: llvm-mca %s -mtriple=x86_64-unknown-unknown -mcpu=slm -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL,SLM %s +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL,BTVER2 %s +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=znver1 -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL %s +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=sandybridge -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL %s +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=ivybridge -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL %s +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=haswell -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL %s +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=broadwell -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL %s +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=knl -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL %s +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=skylake -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL %s +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=skylake-avx512 -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL %s +# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=slm -iterations=1 -all-stats=false -all-views=false -register-file-stats < %s | FileCheck --check-prefixes=ALL %s xor %eax, %ebx -# ALL: Register File statistics: -# ALL-NEXT: Total number of mappings created: 2 -# ALL-NEXT: Max number of mappings used: 2 +# ALL: Register File statistics: +# ALL-NEXT: Total number of mappings created: 2 +# ALL-NEXT: Max number of mappings used: 2 -# BTVER2: * Register File #1 -- JFpuPRF: -# BTVER2-NEXT: Number of physical registers: 72 -# BTVER2-NEXT: Total number of mappings created: 0 -# BTVER2-NEXT: Max number of mappings used: 0 +# BTVER2: * Register File #1 -- JFpuPRF: +# BTVER2-NEXT: Number of physical registers: 72 +# BTVER2-NEXT: Total number of mappings created: 0 +# BTVER2-NEXT: Max number of mappings used: 0 -# BTVER2: * Register File #2 -- JIntegerPRF: -# BTVER2-NEXT: Number of physical registers: 64 -# BTVER2-NEXT: Total number of mappings created: 2 -# BTVER2-NEXT: Max number of mappings used: 2 +# BTVER2: * Register File #2 -- JIntegerPRF: +# BTVER2-NEXT: Number of physical registers: 64 +# BTVER2-NEXT: Total number of mappings created: 2 +# BTVER2-NEXT: Max number of mappings used: 2 Index: utils/update_mca_test_checks.py =================================================================== --- utils/update_mca_test_checks.py +++ utils/update_mca_test_checks.py @@ -321,6 +321,9 @@ _warn('Multiple prefixes generating same output: {} ' '(discarding {})'.format(','.join(s), ','.join(s[1:]))) + if block_text and not current_set: + raise Error( + 'block not captured by existing prefixes:\n\n{}'.format(block_text)) block_infos[block_num][block_text] = sorted(list(current_set)) # If we have multiple block_texts, try to break them down further to avoid @@ -341,10 +344,12 @@ def _write_block(output, block, not_prefix_set, common_prefix, prefix_pad): """ Write an individual block, with correct padding on the prefixes. + Returns a set of all of the prefixes that it has written. """ end_prefix = ': ' previous_prefix = None num_lines_of_prefix = 0 + written_prefixes = set() for prefix, line in block: if prefix in not_prefix_set: @@ -364,6 +369,7 @@ num_lines_of_prefix = 0 previous_prefix = prefix + written_prefixes.add(prefix) output.append( '{} {}{}{} {}'.format(COMMENT_CHAR, prefix, @@ -373,6 +379,7 @@ end_prefix = '-NEXT:' output.append('') + return written_prefixes def _write_output(test_path, input_lines, prefix_list, block_infos, # noqa @@ -416,6 +423,7 @@ output_lines.append('') output_check_lines = [] + used_prefixes = set() for block_num in range(len(block_infos)): for block_text in sorted(block_infos[block_num]): if not block_text: @@ -423,22 +431,26 @@ if type(block_infos[block_num]) is list: # The block is of the type output from _break_down_block(). - _write_block(output_check_lines, - block_infos[block_num], - not_prefix_set, - common_prefix, - prefix_pad) + used_prefixes.update(_write_block(output_check_lines, + block_infos[block_num], + not_prefix_set, + common_prefix, + prefix_pad)) break elif block_infos[block_num][block_text]: # _break_down_block() was unable to do do anything so output the block # as-is. lines = block_text.split('\n') for prefix in block_infos[block_num][block_text]: - _write_block(output_check_lines, - [(prefix, line) for line in lines], - not_prefix_set, - common_prefix, - prefix_pad) + used_prefixes.update(_write_block(output_check_lines, + [(prefix, line) for line in lines], + not_prefix_set, + common_prefix, + prefix_pad)) + + unused_prefixes = (prefix_set - not_prefix_set) - used_prefixes + if unused_prefixes: + raise Error('unused prefixes: {}'.format(sorted(unused_prefixes))) if output_check_lines: output_lines.insert(0, ADVERT)