llvm-project/llvm/test/tools/llvm-mca/X86/BtVer2
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
..
add-sequence.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
clear-super-register-1.s [X86][Btver2] Fix BSF/BSR schedule 2018-09-28 10:26:48 +00:00
clear-super-register-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
dependency-breaking-cmp.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
dependency-breaking-pcmpeq.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
dependency-breaking-pcmpgt.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
dependency-breaking-sbb-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
dependency-breaking-sbb-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
dependent-pmuld-paddd.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
dot-product.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
hadd-read-after-ld-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
hadd-read-after-ld-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
instruction-info-view.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
load-store-alias.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
memcpy-like-test.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
one-idioms.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
partial-reg-update-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
partial-reg-update-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
partial-reg-update-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
partial-reg-update-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
partial-reg-update-6.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
partial-reg-update.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
pipes-fpu.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
pr37790.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
rank.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
rcu-statistics.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-advance-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-advance-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
read-advance-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
reg-move-elimination-1.s [tblgen][llvm-mca] Add the ability to describe move elimination candidates via tablegen. 2018-10-12 11:23:04 +00:00
reg-move-elimination-2.s [tblgen][llvm-mca] Add the ability to describe move elimination candidates via tablegen. 2018-10-12 11:23:04 +00:00
reg-move-elimination-3.s [tblgen][llvm-mca] Add the ability to describe move elimination candidates via tablegen. 2018-10-12 11:23:04 +00:00
reg-move-elimination-4.s [tblgen][llvm-mca] Add the ability to describe move elimination candidates via tablegen. 2018-10-12 11:23:04 +00:00
reg-move-elimination-5.s [tblgen][llvm-mca] Add the ability to describe move elimination candidates via tablegen. 2018-10-12 11:23:04 +00:00
register-files-1.s [llvm-mca] Report the number of dispatched micro opcodes in the DispatchStatistics view. 2018-08-30 10:50:20 +00:00
register-files-2.s [llvm-mca] Report the number of dispatched micro opcodes in the DispatchStatistics view. 2018-08-30 10:50:20 +00:00
register-files-3.s [llvm-mca] Report the number of dispatched micro opcodes in the DispatchStatistics view. 2018-08-30 10:50:20 +00:00
register-files-4.s [llvm-mca] Report the number of dispatched micro opcodes in the DispatchStatistics view. 2018-08-30 10:50:20 +00:00
register-files-5.s [llvm-mca] Report the number of dispatched micro opcodes in the DispatchStatistics view. 2018-08-30 10:50:20 +00:00
resources-aes.s [X86][Btver2] Fix BLENDV and AESDEC schedules 2018-10-02 15:13:18 +00:00
resources-avx1.s [X86][Btver2] Fix BLENDV and AESDEC schedules 2018-10-02 15:13:18 +00:00
resources-bmi1.s [X86][Btver2] BLSI/BLSMSK/BLSR instructions take 2uops not 1 (same as TZCNT) 2018-09-27 14:57:57 +00:00
resources-cmov.s [llvm-mca] Use a different character to flag instructions with side-effects in the Instruction Info View. NFC 2018-07-11 12:44:44 +00:00
resources-cmpxchg.s [llvm-mca][x86] Add CMPXCHG instruction resource tests 2018-08-01 17:25:11 +00:00
resources-f16c.s [llvm-mca] Use a different character to flag instructions with side-effects in the Instruction Info View. NFC 2018-07-11 12:44:44 +00:00
resources-lea.s [X86][BtVer2] correctly model the latency/throughput of LEA instructions. 2018-07-19 16:42:15 +00:00
resources-lzcnt.s [llvm-mca] Use a different character to flag instructions with side-effects in the Instruction Info View. NFC 2018-07-11 12:44:44 +00:00
resources-mmx.s [llvm-mca] Use a different character to flag instructions with side-effects in the Instruction Info View. NFC 2018-07-11 12:44:44 +00:00
resources-movbe.s [llvm-mca][x86] Add MOVBE resource tests to all supporting targets 2018-07-17 17:41:45 +00:00
resources-pclmul.s [llvm-mca][x86] Add PCLMUL instruction resource tests 2018-08-01 16:25:50 +00:00
resources-popcnt.s [llvm-mca] Use a different character to flag instructions with side-effects in the Instruction Info View. NFC 2018-07-11 12:44:44 +00:00
resources-prefetchw.s [llvm-mca][x86] Add PREFETCHW instruction resource tests 2018-08-01 16:34:39 +00:00
resources-sse1.s [X86][Btver2] CVTSS2I/CVTSD2I - add missing JFPU0 pipe 2018-09-28 13:19:22 +00:00
resources-sse2.s [X86][Btver2] CVTSS2I/CVTSD2I - add missing JFPU0 pipe 2018-09-28 13:19:22 +00:00
resources-sse3.s [llvm-mca] Use a different character to flag instructions with side-effects in the Instruction Info View. NFC 2018-07-11 12:44:44 +00:00
resources-sse4a.s [llvm-mca] Use a different character to flag instructions with side-effects in the Instruction Info View. NFC 2018-07-11 12:44:44 +00:00
resources-sse41.s [X86][Btver2] Fix BLENDV and AESDEC schedules 2018-10-02 15:13:18 +00:00
resources-sse42.s [X86][Btver2] Fix PCmpIStrI/PCmpIStrM schedules 2018-09-30 16:38:38 +00:00
resources-ssse3.s [X86][Btver2] Fix MMX PSHUFB schedule 2018-10-03 18:18:50 +00:00
resources-x86_32.s [llvm-mca][x86] Add 32-bit instruction resource tests 2018-07-31 17:33:08 +00:00
resources-x86_64.s [X86][Btver2] Most RMW instructions don't require an additional uop 2018-10-03 10:28:43 +00:00
resources-x87.s [llvm-mca] Use a different character to flag instructions with side-effects in the Instruction Info View. NFC 2018-07-11 12:44:44 +00:00
scheduler-queue-usage.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
simple-test.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
unsupported-instruction.s [llvm-mca] report an error if the assembly sequence contains an unsupported instruction. 2018-07-09 12:30:55 +00:00
vbroadcast-operand-latency.s [X86][BtVer2] Remove wrong ReadAdvance from AVX vbroadcast(ss|sd|f128) instructions. 2018-08-31 16:05:48 +00:00
vec-logic-read-after-ld-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
vec-logic-read-after-ld-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
zero-idioms-avx-256.s [X86][BtVer2] Teach how to identify zero-idiom VPERM2F128rr instructions. 2018-10-01 10:35:13 +00:00
zero-idioms.s [X86][Btver2] PSUBS/PSUBUS instructions are zero-idioms 2018-09-28 14:20:42 +00:00