[PATCH] D49310: [llvm-mca][BtVer2] Teach how to identify dependency-breaking idioms.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 20 08:43:00 PDT 2018


lebedev.ri added inline comments.


================
Comment at: tools/llvm-mca/DispatchStage.cpp:110
   // An example of dependency-breaking instruction on X86 is a zero-idiom XOR.
-  if (!Desc.isZeroLatency())
-    for (std::unique_ptr<ReadState> &RS : IS.getUses())
----------------
andreadb wrote:
> andreadb wrote:
> > lebedev.ri wrote:
> > > andreadb wrote:
> > > > lebedev.ri wrote:
> > > > > So it will no longer even consider the sched profile?
> > > > Not sure I understand the question. I am definitely using profile information from the scheduling model.
> > > What i'm asking is - what happens if sched model says that instruction N has zero latency, but `isDependencyBreaking()` does not say that?
> > In that case, instruction N will have to wait in the scheduler until input registers are all available. Then it is executed.
> If it doesn’t work like that, then there is a bug. I cannot test it at the moment as I am not at work. I will check it on next days. Thanks.
So the scheduler-profile-aware instruction scheduler will schedule it as-if it has zero latency,
but the mca-based analysis will not?
And how would one go about detecting such inconsistencies?
This all makes me uneasy.



https://reviews.llvm.org/D49310





More information about the llvm-commits mailing list