[PATCH] D46983: [llvm-mca] Make Dispatch a subclass of Stage.

Matt Davis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 16 15:27:50 PDT 2018


mattd created this revision.
mattd added reviewers: andreadb, courbet, RKSimon.
Herald added subscribers: gbedwell, tschuett, javed.absar, mgorny.

The logic of dispatch remains the same, but now DispatchUnit is a Stage (DispatchStage).

This change has the benefit of simplifying the backend runCycle() code.
The same logic applies, but it belongs to different components now.  This is just a start,
eventually we will need to remove the call to the DispatchStage in Scheduler.cpp, but
that will be a separate patch.  This change is mostly a renaming and moving of existing logic.

This change also encouraged me to remove the Subtarget (STI) member from the
Backend class.  That member was used to initialize the other members of Backend
and to eventually call DispatchUnit::dispatch().  Now that we have Stages, we
can eliminate this by instantiating the DispatchStage with everything it needs
at the time of construction (e.g., Subtarget).  That change allows us to call
DispatchStage::execute(IR) as we expect to call execute() for all other stages.

Once we add the Stage list (https://reviews.llvm.org/D46907) we can more cleanly call preExecute() on
all of the stages, DispatchStage, will probably wrap cycleEvent() in that
case.

Made some formatting and minor cleanups to README.txt.  Some of the text
was re-flowed to stay within 80 cols.


https://reviews.llvm.org/D46983

Files:
  tools/llvm-mca/Backend.cpp
  tools/llvm-mca/Backend.h
  tools/llvm-mca/CMakeLists.txt
  tools/llvm-mca/Dispatch.cpp
  tools/llvm-mca/Dispatch.h
  tools/llvm-mca/DispatchStage.cpp
  tools/llvm-mca/DispatchStage.h
  tools/llvm-mca/HWEventListener.h
  tools/llvm-mca/README.txt
  tools/llvm-mca/RetireControlUnit.cpp
  tools/llvm-mca/RetireControlUnit.h
  tools/llvm-mca/Scheduler.cpp
  tools/llvm-mca/Scheduler.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46983.147198.patch
Type: text/x-patch
Size: 34659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180516/97ea273d/attachment.bin>


More information about the llvm-commits mailing list