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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 03:38:13 PDT 2018


RKSimon added inline comments.


================
Comment at: include/llvm/MC/MCInstrAnalysis.h:97
+  /// dependency breaking instruction doesn't wait on the input register, since
+  /// the result is not dependent on its value.
+  virtual bool isDependencyBreaking(const MCSubtargetInfo &STI,
----------------
I don't know if this description is too x86 specific or not - AFAICT the actual 'same register' test is inside X86MCInstrAnalysis::isDependencyBreaking so it isn't a generic requirement?

An alternative approach could be for MCInstrAnalysis::isDependencyBreaking to return true if the instruction is independent of some/all of its input operands and a APInt& Mask (or similar) is used to list the operands that it doesn't depend upon - not sure if we need all that functionality or not though so it might be over-engineering it.

Also, do you know if we can make use of this in the machine schedulers or whatever? I'm not against it being inside MCInstrAnalysis in general although the fact that its so cpu-target specific suggests it could get bulky. @craig.topper What do you think?


https://reviews.llvm.org/D49310





More information about the llvm-commits mailing list