[PATCH] D46367: [llvm-mca] Avoid exposing index values in the MCA interfaces.

Matt Davis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 6 20:34:17 PDT 2018


mattd updated this revision to Diff 145423.
mattd marked 6 inline comments as done and an inline comment as not done.
mattd added a comment.

Updated this patch per some of the comments discussed:

- Rebased against the ToT.
- Added an NDEBUG guard to the debug output routine.  I wanted to keep this routine to eliminate calls to getSourceIndex in our debug output.  This allows us to keep the syntax in debug output code clean.
- Made a pointer a const ref for the formal parameter in RCU's reserveSlot().  I'm not sure why it was treated as a pointer previously.  I have a feeling my earlier version of this patch was tossing around a Instruction * in that case, and I never adjusted for that.
- I wanted to remove the copy of the InstRef in the RUToken queue.  That queue is a std::vector which we resize.  This container requires a default InstRef ctor.

These changes allow us to partially decouple the RCU and Backend, in other words I've removed the Backend's "getInstruction" function.  Only one eventing routine is still coupled to an index value, which couples the RCU and backend, eraseInstruction.  However, in the future we will make the RCU the owner  of instructions, so that coupling  between components will disappear, as the RCU will be responsible for eraseInstrcuction.


https://reviews.llvm.org/D46367

Files:
  tools/llvm-mca/Backend.cpp
  tools/llvm-mca/Backend.h
  tools/llvm-mca/Dispatch.cpp
  tools/llvm-mca/Dispatch.h
  tools/llvm-mca/HWEventListener.h
  tools/llvm-mca/Instruction.h
  tools/llvm-mca/InstructionTables.cpp
  tools/llvm-mca/LSUnit.cpp
  tools/llvm-mca/LSUnit.h
  tools/llvm-mca/ResourcePressureView.cpp
  tools/llvm-mca/RetireControlUnit.cpp
  tools/llvm-mca/RetireControlUnit.h
  tools/llvm-mca/Scheduler.cpp
  tools/llvm-mca/Scheduler.h
  tools/llvm-mca/SourceMgr.h
  tools/llvm-mca/TimelineView.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46367.145423.patch
Type: text/x-patch
Size: 37142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180507/b94f6363/attachment.bin>


More information about the llvm-commits mailing list