This patch teaches llvm-mca how to identify dependency breaking instructions on btver2.
An example of dependency breaking instruction is the zero-idiom XOR (example: XOR %eax, %eax), which always generates zero regardless of the actual input register value.
Dependency breaking instructions don't have to wait on their input register operands before executing. This is because the result of the execution is known in advance (i.e. it is not dependent on the actual value of the input register).
Not all dependency breaking idioms are also zero-latency instructions. For example, CMPEQ %xmm1, %xmm1 sets %xmm1 to all-ones, and it is executed by a pipeline.
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, and return a value which better matches the subtarget processor behavior.
BtVer2 tests that have been affected by this change now return the expected number of instructions per cycle.
Please let me know if okay to commit.
-Andrea
Suggestion: It might be useful to reference Agner Fog's microarchitecture.pdf 17.9 "Breaking dependence," similar to how you reference another part of that doc in D49196. Although, I think your description is clearer than 17.9, but just a thought. A reader might find other parts of 17.x useful, such as 17.8.