llvm-project/llvm/lib/Target/X86/MCTargetDesc
Andrea Di Biagio a1852b6194 [llvm-mca][BtVer2] Teach how to identify dependency-breaking idioms.
This patch teaches llvm-mca how to identify dependency breaking instructions on
btver2.

An example of dependency breaking instructions is the zero-idiom XOR (example:
`XOR %eax, %eax`), which always generates zero regardless of the actual value of
the input register operands.
Dependency breaking instructions don't have to wait on their input register
operands before executing. This is because the computation is not dependent on
the inputs.

Not all dependency breaking idioms are also zero-latency instructions. For
example, `CMPEQ %xmm1, %xmm1` is independent on
the value of XMM1, and it generates a vector of all-ones.
That instruction is not eliminated at register renaming stage, and its opcode is
issued to a pipeline for execution. So, the latency is not zero. 

This patch adds a new method named isDependencyBreaking() to the MCInstrAnalysis
interface. That method takes as input an instruction (i.e. MCInst) and a
MCSubtargetInfo.
The default implementation of isDependencyBreaking() conservatively returns
false for all instructions. Targets may override the default behavior for
specific CPUs, and return a value which better matches the subtarget behavior.

In future, we should teach to Tablegen how to automatically generate the body of
isDependencyBreaking from scheduling predicate definitions. This would allow us
to expose the knowledge about dependency breaking instructions to the machine
schedulers (and, potentially, other codegen passes).

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

llvm-svn: 338372
2018-07-31 13:21:43 +00:00
..
CMakeLists.txt [codeview] Implement FPO data assembler directives 2017-10-11 21:24:33 +00:00
LLVMBuild.txt
X86AsmBackend.cpp [MC] Pass MCSubtargetInfo to fixupNeedsRelaxation and applyFixup 2018-06-06 09:40:06 +00:00
X86BaseInfo.h [X86] Remove FMA3Info DenseMap. Break into sorted tables that we can binary search. 2018-07-02 06:23:39 +00:00
X86ELFObjectWriter.cpp MC: Separate creating a generic object writer from creating a target object writer. NFCI. 2018-05-21 19:20:29 +00:00
X86FixupKinds.h [llvm-mc] - Produce R_X86_64_PLT32 for "call/jmp foo". 2018-02-20 10:17:57 +00:00
X86MCAsmInfo.cpp Remove redundant includes from lib/Target/X86. 2017-12-13 21:31:19 +00:00
X86MCAsmInfo.h
X86MCCodeEmitter.cpp [X86] Make %eiz usage in 64-bit mode, force a 0x67 address size prefix. Fix some test CHECK lines. 2018-06-23 06:15:04 +00:00
X86MCExpr.h [MC][X86] Allow assembler variable assignment to register name. 2018-06-05 15:13:39 +00:00
X86MCTargetDesc.cpp [llvm-mca][BtVer2] Teach how to identify dependency-breaking idioms. 2018-07-31 13:21:43 +00:00
X86MCTargetDesc.h [X86][BtVer2] correctly model the latency/throughput of LEA instructions. 2018-07-19 16:42:15 +00:00
X86MachObjectWriter.cpp MC: Separate creating a generic object writer from creating a target object writer. NFCI. 2018-05-21 19:20:29 +00:00
X86TargetStreamer.h [codeview] Implement FPO data assembler directives 2017-10-11 21:24:33 +00:00
X86WinCOFFObjectWriter.cpp MC: Separate creating a generic object writer from creating a target object writer. NFCI. 2018-05-21 19:20:29 +00:00
X86WinCOFFStreamer.cpp MC: Change the streamer ctors to take an object writer instead of a stream. NFCI. 2018-05-18 18:26:45 +00:00
X86WinCOFFTargetStreamer.cpp [codeview] Implement FPO data assembler directives 2017-10-11 21:24:33 +00:00