[PATCH] D50929: [llvm-mca] Introduce the llvm-mca library and organize the directory accordingly. NFC.

Matt Davis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 17 15:38:13 PDT 2018


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

This patch introduces llvm-mca as a library.  The driver (llvm-mca.cpp), views, and stats, are not part of the library. 
Those are separate components that are not required for the functioning of llvm-mca.

The directory has been organized as follows:
All library source files now reside in:

- `lib/HardwareUnits/` - All subclasses of HardwareUnit (these represent the simulated hardware components of a backend). (LSUnit does not inherit from HardwareUnit, but Scheduler does which uses LSUnit).
- `lib/Stages/` - All subclasses of the pipeline stages.
- `lib/` - This is the root of the library and contains library code that does not fit into the Stages or HardwareUnit subdirs.

All library include files now reside in the `include` directory and mimic the same layout as the `lib` directory mentioned above.

In the (near) future we would like to move the library (include and lib) contents from tools and into the core of llvm somewhere.
That change would allow various analysis and optimization passes to make use of MCA  functionality for things like cost modeling.

I left all of the non-library code just where it has always been, in the root of the llvm-mca directory. 
The include directives for the non-library source file have been updated to refer to the llvm-mca library headers.
I updated the llvm-mca/CMakeLists.txt file to include the library headers, but I made the non-library code
explicitly reference the library's 'include' directory.  Once we eventually (hopefully) migrate the MCA library
components into llvm the include directives used by the non-library source files will be updated to point to the
proper location in llvm.

I would like to place the Views and Stats into separate (non-library) directories, just to keep things better organized, but that would be a
separate patch.


https://reviews.llvm.org/D50929

Files:
  tools/llvm-mca/CMakeLists.txt
  tools/llvm-mca/CodeRegion.cpp
  tools/llvm-mca/CodeRegion.h
  tools/llvm-mca/Context.cpp
  tools/llvm-mca/Context.h
  tools/llvm-mca/DispatchStage.cpp
  tools/llvm-mca/DispatchStage.h
  tools/llvm-mca/ExecuteStage.cpp
  tools/llvm-mca/ExecuteStage.h
  tools/llvm-mca/FetchStage.cpp
  tools/llvm-mca/FetchStage.h
  tools/llvm-mca/HWEventListener.cpp
  tools/llvm-mca/HWEventListener.h
  tools/llvm-mca/HardwareUnit.cpp
  tools/llvm-mca/HardwareUnit.h
  tools/llvm-mca/InstrBuilder.cpp
  tools/llvm-mca/InstrBuilder.h
  tools/llvm-mca/Instruction.cpp
  tools/llvm-mca/Instruction.h
  tools/llvm-mca/InstructionInfoView.h
  tools/llvm-mca/InstructionTables.cpp
  tools/llvm-mca/InstructionTables.h
  tools/llvm-mca/LSUnit.cpp
  tools/llvm-mca/LSUnit.h
  tools/llvm-mca/Pipeline.cpp
  tools/llvm-mca/Pipeline.h
  tools/llvm-mca/PipelinePrinter.h
  tools/llvm-mca/RegisterFile.cpp
  tools/llvm-mca/RegisterFile.h
  tools/llvm-mca/ResourcePressureView.h
  tools/llvm-mca/RetireControlUnit.cpp
  tools/llvm-mca/RetireControlUnit.h
  tools/llvm-mca/RetireStage.cpp
  tools/llvm-mca/RetireStage.h
  tools/llvm-mca/Scheduler.cpp
  tools/llvm-mca/Scheduler.h
  tools/llvm-mca/SourceMgr.h
  tools/llvm-mca/Stage.cpp
  tools/llvm-mca/Stage.h
  tools/llvm-mca/SummaryView.cpp
  tools/llvm-mca/SummaryView.h
  tools/llvm-mca/Support.cpp
  tools/llvm-mca/Support.h
  tools/llvm-mca/TimelineView.h
  tools/llvm-mca/View.h
  tools/llvm-mca/include/CodeRegion.h
  tools/llvm-mca/include/Context.h
  tools/llvm-mca/include/HWEventListener.h
  tools/llvm-mca/include/HardwareUnits/HardwareUnit.h
  tools/llvm-mca/include/HardwareUnits/LSUnit.h
  tools/llvm-mca/include/HardwareUnits/RegisterFile.h
  tools/llvm-mca/include/HardwareUnits/RetireControlUnit.h
  tools/llvm-mca/include/HardwareUnits/Scheduler.h
  tools/llvm-mca/include/InstrBuilder.h
  tools/llvm-mca/include/Instruction.h
  tools/llvm-mca/include/Pipeline.h
  tools/llvm-mca/include/SourceMgr.h
  tools/llvm-mca/include/Stages/DispatchStage.h
  tools/llvm-mca/include/Stages/ExecuteStage.h
  tools/llvm-mca/include/Stages/FetchStage.h
  tools/llvm-mca/include/Stages/InstructionTables.h
  tools/llvm-mca/include/Stages/RetireStage.h
  tools/llvm-mca/include/Stages/Stage.h
  tools/llvm-mca/include/Support.h
  tools/llvm-mca/lib/CMakeLists.txt
  tools/llvm-mca/lib/CodeRegion.cpp
  tools/llvm-mca/lib/Context.cpp
  tools/llvm-mca/lib/HWEventListener.cpp
  tools/llvm-mca/lib/HardwareUnits/HardwareUnit.cpp
  tools/llvm-mca/lib/HardwareUnits/LSUnit.cpp
  tools/llvm-mca/lib/HardwareUnits/RegisterFile.cpp
  tools/llvm-mca/lib/HardwareUnits/RetireControlUnit.cpp
  tools/llvm-mca/lib/HardwareUnits/Scheduler.cpp
  tools/llvm-mca/lib/InstrBuilder.cpp
  tools/llvm-mca/lib/Instruction.cpp
  tools/llvm-mca/lib/Pipeline.cpp
  tools/llvm-mca/lib/Stages/DispatchStage.cpp
  tools/llvm-mca/lib/Stages/ExecuteStage.cpp
  tools/llvm-mca/lib/Stages/FetchStage.cpp
  tools/llvm-mca/lib/Stages/InstructionTables.cpp
  tools/llvm-mca/lib/Stages/RetireStage.cpp
  tools/llvm-mca/lib/Stages/Stage.cpp
  tools/llvm-mca/lib/Support.cpp
  tools/llvm-mca/llvm-mca.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50929.161349.patch
Type: text/x-patch
Size: 16990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180817/497955c0/attachment.bin>


More information about the llvm-commits mailing list