[llvm-mca] Introduce the llvm-mca library and organize the directory accordingly...
authorMatt Davis <Matthew.Davis@sony.com>
Mon, 27 Aug 2018 17:16:32 +0000 (17:16 +0000)
committerMatt Davis <Matthew.Davis@sony.com>
Mon, 27 Aug 2018 17:16:32 +0000 (17:16 +0000)
commit271ce76352fdef802e6ecea7d1a9bb595963b609
tree6e1615bba5451f7e3be62f6b88cf339c0294a18d
parentb09ecf93060d982c26fa036c9beb1140b7e5f627
[llvm-mca] Introduce the llvm-mca library and organize the directory accordingly. NFC.

Summary:
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 header 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.

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb

Subscribers: mgorny, javed.absar, tschuett, gbedwell, llvm-commits

Differential Revision: https://reviews.llvm.org/D50929

llvm-svn: 340755
41 files changed:
llvm/tools/llvm-mca/CMakeLists.txt
llvm/tools/llvm-mca/include/Context.h [moved from llvm/tools/llvm-mca/Context.h with 98% similarity]
llvm/tools/llvm-mca/include/HWEventListener.h [moved from llvm/tools/llvm-mca/HWEventListener.h with 100% similarity]
llvm/tools/llvm-mca/include/HardwareUnits/HardwareUnit.h [moved from llvm/tools/llvm-mca/HardwareUnit.h with 100% similarity]
llvm/tools/llvm-mca/include/HardwareUnits/LSUnit.h [moved from llvm/tools/llvm-mca/LSUnit.h with 99% similarity]
llvm/tools/llvm-mca/include/HardwareUnits/RegisterFile.h [moved from llvm/tools/llvm-mca/RegisterFile.h with 99% similarity]
llvm/tools/llvm-mca/include/HardwareUnits/ResourceManager.h [moved from llvm/tools/llvm-mca/ResourceManager.h with 100% similarity]
llvm/tools/llvm-mca/include/HardwareUnits/RetireControlUnit.h [moved from llvm/tools/llvm-mca/RetireControlUnit.h with 98% similarity]
llvm/tools/llvm-mca/include/HardwareUnits/Scheduler.h [moved from llvm/tools/llvm-mca/Scheduler.h with 99% similarity]
llvm/tools/llvm-mca/include/InstrBuilder.h [moved from llvm/tools/llvm-mca/InstrBuilder.h with 100% similarity]
llvm/tools/llvm-mca/include/Instruction.h [moved from llvm/tools/llvm-mca/Instruction.h with 100% similarity]
llvm/tools/llvm-mca/include/Pipeline.h [moved from llvm/tools/llvm-mca/Pipeline.h with 97% similarity]
llvm/tools/llvm-mca/include/SourceMgr.h [moved from llvm/tools/llvm-mca/SourceMgr.h with 100% similarity]
llvm/tools/llvm-mca/include/Stages/DispatchStage.h [moved from llvm/tools/llvm-mca/DispatchStage.h with 96% similarity]
llvm/tools/llvm-mca/include/Stages/ExecuteStage.h [moved from llvm/tools/llvm-mca/ExecuteStage.h with 97% similarity]
llvm/tools/llvm-mca/include/Stages/FetchStage.h [moved from llvm/tools/llvm-mca/FetchStage.h with 98% similarity]
llvm/tools/llvm-mca/include/Stages/InstructionTables.h [moved from llvm/tools/llvm-mca/InstructionTables.h with 95% similarity]
llvm/tools/llvm-mca/include/Stages/RetireStage.h [moved from llvm/tools/llvm-mca/RetireStage.h with 92% similarity]
llvm/tools/llvm-mca/include/Stages/Stage.h [moved from llvm/tools/llvm-mca/Stage.h with 100% similarity]
llvm/tools/llvm-mca/include/Support.h [moved from llvm/tools/llvm-mca/Support.h with 100% similarity]
llvm/tools/llvm-mca/lib/CMakeLists.txt [new file with mode: 0644]
llvm/tools/llvm-mca/lib/Context.cpp [moved from llvm/tools/llvm-mca/Context.cpp with 89% similarity]
llvm/tools/llvm-mca/lib/HWEventListener.cpp [moved from llvm/tools/llvm-mca/HWEventListener.cpp with 100% similarity]
llvm/tools/llvm-mca/lib/HardwareUnits/HardwareUnit.cpp [moved from llvm/tools/llvm-mca/HardwareUnit.cpp with 94% similarity]
llvm/tools/llvm-mca/lib/HardwareUnits/LSUnit.cpp [moved from llvm/tools/llvm-mca/LSUnit.cpp with 99% similarity]
llvm/tools/llvm-mca/lib/HardwareUnits/RegisterFile.cpp [moved from llvm/tools/llvm-mca/RegisterFile.cpp with 99% similarity]
llvm/tools/llvm-mca/lib/HardwareUnits/ResourceManager.cpp [moved from llvm/tools/llvm-mca/ResourceManager.cpp with 99% similarity]
llvm/tools/llvm-mca/lib/HardwareUnits/RetireControlUnit.cpp [moved from llvm/tools/llvm-mca/RetireControlUnit.cpp with 98% similarity]
llvm/tools/llvm-mca/lib/HardwareUnits/Scheduler.cpp [moved from llvm/tools/llvm-mca/Scheduler.cpp with 99% similarity]
llvm/tools/llvm-mca/lib/InstrBuilder.cpp [moved from llvm/tools/llvm-mca/InstrBuilder.cpp with 100% similarity]
llvm/tools/llvm-mca/lib/Instruction.cpp [moved from llvm/tools/llvm-mca/Instruction.cpp with 100% similarity]
llvm/tools/llvm-mca/lib/LLVMBuild.txt [new file with mode: 0644]
llvm/tools/llvm-mca/lib/Pipeline.cpp [moved from llvm/tools/llvm-mca/Pipeline.cpp with 100% similarity]
llvm/tools/llvm-mca/lib/Stages/DispatchStage.cpp [moved from llvm/tools/llvm-mca/DispatchStage.cpp with 98% similarity]
llvm/tools/llvm-mca/lib/Stages/ExecuteStage.cpp [moved from llvm/tools/llvm-mca/ExecuteStage.cpp with 99% similarity]
llvm/tools/llvm-mca/lib/Stages/FetchStage.cpp [moved from llvm/tools/llvm-mca/FetchStage.cpp with 98% similarity]
llvm/tools/llvm-mca/lib/Stages/InstructionTables.cpp [moved from llvm/tools/llvm-mca/InstructionTables.cpp with 98% similarity]
llvm/tools/llvm-mca/lib/Stages/RetireStage.cpp [moved from llvm/tools/llvm-mca/RetireStage.cpp with 98% similarity]
llvm/tools/llvm-mca/lib/Stages/Stage.cpp [moved from llvm/tools/llvm-mca/Stage.cpp with 96% similarity]
llvm/tools/llvm-mca/lib/Support.cpp [moved from llvm/tools/llvm-mca/Support.cpp with 100% similarity]
llvm/tools/llvm-mca/llvm-mca.cpp