llvm-project/llvm/test/tools/llvm-mca/X86
Andrea Di Biagio 6eebbe0a97 [tblgen][llvm-mca] Add the ability to describe move elimination candidates via tablegen.
This patch adds the ability to identify instructions that are "move elimination
candidates". It also allows scheduling models to describe processor register
files that allow move elimination.

A move elimination candidate is an instruction that can be eliminated at
register renaming stage.
Each subtarget can specify which instructions are move elimination candidates
with the help of tablegen class "IsOptimizableRegisterMove" (see
llvm/Target/TargetInstrPredicate.td).

For example, on X86, BtVer2 allows both GPR and MMX/SSE moves to be eliminated.
The definition of 'IsOptimizableRegisterMove' for BtVer2 looks like this:

```
def : IsOptimizableRegisterMove<[
  InstructionEquivalenceClass<[
    // GPR variants.
    MOV32rr, MOV64rr,

    // MMX variants.
    MMX_MOVQ64rr,

    // SSE variants.
    MOVAPSrr, MOVUPSrr,
    MOVAPDrr, MOVUPDrr,
    MOVDQArr, MOVDQUrr,

    // AVX variants.
    VMOVAPSrr, VMOVUPSrr,
    VMOVAPDrr, VMOVUPDrr,
    VMOVDQArr, VMOVDQUrr
  ], CheckNot<CheckSameRegOperand<0, 1>> >
]>;
```

Definitions of IsOptimizableRegisterMove from processor models of a same
Target are processed by the SubtargetEmitter to auto-generate a target-specific
override for each of the following predicate methods:

```
bool TargetSubtargetInfo::isOptimizableRegisterMove(const MachineInstr *MI)
const;
bool MCInstrAnalysis::isOptimizableRegisterMove(const MCInst &MI, unsigned
CPUID) const;
```

By default, those methods return false (i.e. conservatively assume that there
are no move elimination candidates).

Tablegen class RegisterFile has been extended with the following information:
 - The set of register classes that allow move elimination.
 - Maxium number of moves that can be eliminated every cycle.
 - Whether move elimination is restricted to moves from registers that are
   known to be zero.

This patch is structured in three part:

A first part (which is mostly boilerplate) adds the new
'isOptimizableRegisterMove' target hooks, and extends existing register file
descriptors in MC by introducing new fields to describe properties related to
move elimination.

A second part, uses the new tablegen constructs to describe move elimination in
the BtVer2 scheduling model.

A third part, teaches llm-mca how to query the new 'isOptimizableRegisterMove'
hook to mark instructions that are candidates for move elimination. It also
teaches class RegisterFile how to describe constraints on move elimination at
PRF granularity.

llvm-mca tests for btver2 show differences before/after this patch.

Differential Revision: https://reviews.llvm.org/D53134

llvm-svn: 344334
2018-10-12 11:23:04 +00:00
..
Atom [X86] Fix scheduler class for BTmi instructions 2018-09-30 20:19:16 +00:00
Broadwell [X86][Sched] Update scheduling information for VZEROALL on HWS, BDW, SKX, SNB. 2018-10-01 08:37:48 +00:00
BtVer2 [tblgen][llvm-mca] Add the ability to describe move elimination candidates via tablegen. 2018-10-12 11:23:04 +00:00
Generic [X86][Sched] Update scheduling information for VZEROALL on HWS, BDW, SKX, SNB. 2018-10-01 08:37:48 +00:00
Haswell [X86][Sched] Update scheduling information for VZEROALL on HWS, BDW, SKX, SNB. 2018-10-01 08:37:48 +00:00
SLM [X86] ALU/ADC RMW instructions should use the WriteRMW sequence class 2018-10-03 10:01:13 +00:00
SandyBridge [X86][Sched] Update scheduling information for VZEROALL on HWS, BDW, SKX, SNB. 2018-10-01 08:37:48 +00:00
SkylakeClient [LLVM-MCA][X86] Add missing VCMPESTR/VCMPESTR tests 2018-09-30 18:19:00 +00:00
SkylakeServer [X86][Sched] Update scheduling information for VZEROALL on HWS, BDW, SKX, SNB. 2018-10-01 08:37:48 +00:00
Znver1 [LLVM-MCA][X86] Add missing VCMPESTR/VCMPESTR tests 2018-09-30 18:19:00 +00:00
bextr-read-after-ld.s [utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order 2018-10-04 14:42:19 +00:00
bzhi-read-after-ld.s [utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order 2018-10-04 14:42:19 +00:00
cpus.s [utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order 2018-10-04 14:42:19 +00:00
default-iterations.s [llvm-mca] Add fields "Total uOps" and "uOps Per Cycle" to the report generated by the SummaryView. 2018-08-29 17:56:39 +00:00
dispatch_width.s [llvm-mca] Add fields "Total uOps" and "uOps Per Cycle" to the report generated by the SummaryView. 2018-08-29 17:56:39 +00:00
fma3-read-after-ld-1.s [utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order 2018-10-04 14:42:19 +00:00
fma3-read-after-ld-2.s [utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order 2018-10-04 14:42:19 +00:00
in-order-cpu.s Replace unused output filenames with /dev/null in tests 2018-07-02 18:16:44 +00:00
intel-syntax.s [llvm-mca] Add fields "Total uOps" and "uOps Per Cycle" to the report generated by the SummaryView. 2018-08-29 17:56:39 +00:00
invalid-assembly-sequence.s [llvm-mca] Make sure not to end the test files with an empty line. 2018-06-04 11:48:46 +00:00
invalid-cpu.s Replace unused output filenames with /dev/null in tests 2018-07-02 18:16:44 +00:00
invalid-empty-file.s Replace unused output filenames with /dev/null in tests 2018-07-02 18:16:44 +00:00
lit.local.cfg
llvm-mca-markers-1.s [llvm-mca] Make sure not to end the test files with an empty line. 2018-06-04 11:48:46 +00:00
llvm-mca-markers-2.s [llvm-mca] Add fields "Total uOps" and "uOps Per Cycle" to the report generated by the SummaryView. 2018-08-29 17:56:39 +00:00
llvm-mca-markers-3.s [llvm-mca] Add fields "Total uOps" and "uOps Per Cycle" to the report generated by the SummaryView. 2018-08-29 17:56:39 +00:00
llvm-mca-markers-4.s [llvm-mca] Add fields "Total uOps" and "uOps Per Cycle" to the report generated by the SummaryView. 2018-08-29 17:56:39 +00:00
llvm-mca-markers-5.s [llvm-mca] Add fields "Total uOps" and "uOps Per Cycle" to the report generated by the SummaryView. 2018-08-29 17:56:39 +00:00
llvm-mca-markers-6.s [llvm-mca] Make sure not to end the test files with an empty line. 2018-06-04 11:48:46 +00:00
llvm-mca-markers-7.s [llvm-mca] Make sure not to end the test files with an empty line. 2018-06-04 11:48:46 +00:00
no-sched-model.s [llvm-mca] Make sure not to end the test files with an empty line. 2018-06-04 11:48:46 +00:00
option-all-stats-1.s [utils] Allow better identification of matching blocks in update_mca_test_checks.py 2018-09-28 15:38:56 +00:00
option-all-stats-2.s [utils] Allow better identification of matching blocks in update_mca_test_checks.py 2018-09-28 15:38:56 +00:00
option-all-views-1.s [utils] Allow better identification of matching blocks in update_mca_test_checks.py 2018-09-28 15:38:56 +00:00
option-all-views-2.s [utils] Stricter checking from update_mca_test_checks.py 2018-09-28 15:39:09 +00:00
option-no-stats-1.s [llvm-mca] Add fields "Total uOps" and "uOps Per Cycle" to the report generated by the SummaryView. 2018-08-29 17:56:39 +00:00
read-after-ld-1.s [X86] Move ReadAfterLd functionality into X86FoldableSchedWrite (PR36957) 2018-10-05 17:57:29 +00:00
read-after-ld-2.s [X86] Move ReadAfterLd functionality into X86FoldableSchedWrite (PR36957) 2018-10-05 17:57:29 +00:00
read-after-ld-3.s [llvm-mca][x86] Add PR36951 ReadAfterLd test case 2018-10-04 16:26:56 +00:00
register-file-statistics.s [utils] Stricter checking from update_mca_test_checks.py 2018-09-28 15:39:09 +00:00
scheduler-queue-usage.s [utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order 2018-10-04 14:42:19 +00:00
sqrt-rsqrt-rcp-memop.s [utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order 2018-10-04 14:42:19 +00:00
variable-blend-read-after-ld-1.s [utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order 2018-10-04 14:42:19 +00:00
variable-blend-read-after-ld-2.s [utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order 2018-10-04 14:42:19 +00:00