Index: tools/llvm-mca/CMakeLists.txt =================================================================== --- tools/llvm-mca/CMakeLists.txt +++ tools/llvm-mca/CMakeLists.txt @@ -5,36 +5,19 @@ AllTargetsDisassemblers AllTargetsInfos MC + MCAComponents + MCAStages + MCAUtils + MCAViews MCParser Support ) add_llvm_tool(llvm-mca - Backend.cpp - BackendPrinter.cpp - CodeRegion.cpp - DispatchStage.cpp - DispatchStatistics.cpp - ExecuteStage.cpp - FetchStage.cpp - HWEventListener.cpp - InstrBuilder.cpp - Instruction.cpp - InstructionInfoView.cpp - InstructionTables.cpp - LSUnit.cpp llvm-mca.cpp - RegisterFile.cpp - RegisterFileStatistics.cpp - ResourcePressureView.cpp - RetireControlUnit.cpp - RetireControlUnitStatistics.cpp - RetireStage.cpp - Scheduler.cpp - SchedulerStatistics.cpp - Stage.cpp - Support.cpp - SummaryView.cpp - TimelineView.cpp - View.cpp ) + +add_subdirectory(Components) +add_subdirectory(Stages) +add_subdirectory(Utils) +add_subdirectory(Views) Index: tools/llvm-mca/Components/Backend.h =================================================================== --- tools/llvm-mca/Components/Backend.h +++ tools/llvm-mca/Components/Backend.h @@ -15,14 +15,14 @@ #ifndef LLVM_TOOLS_LLVM_MCA_BACKEND_H #define LLVM_TOOLS_LLVM_MCA_BACKEND_H -#include "DispatchStage.h" -#include "ExecuteStage.h" -#include "FetchStage.h" -#include "InstrBuilder.h" -#include "RegisterFile.h" -#include "RetireControlUnit.h" -#include "RetireStage.h" -#include "Scheduler.h" +#include "Components/RegisterFile.h" +#include "Components/RetireControlUnit.h" +#include "Components/Scheduler.h" +#include "Stages/DispatchStage.h" +#include "Stages/ExecuteStage.h" +#include "Stages/FetchStage.h" +#include "Stages/RetireStage.h" +#include "Utils/InstrBuilder.h" namespace mca { Index: tools/llvm-mca/Components/Backend.cpp =================================================================== --- tools/llvm-mca/Components/Backend.cpp +++ tools/llvm-mca/Components/Backend.cpp @@ -13,8 +13,8 @@ //===----------------------------------------------------------------------===// #include "Backend.h" -#include "FetchStage.h" -#include "HWEventListener.h" +#include "Stages/FetchStage.h" +#include "Utils/HWEventListener.h" #include "llvm/CodeGen/TargetSchedule.h" #include "llvm/Support/Debug.h" Index: tools/llvm-mca/Components/BackendPrinter.h =================================================================== --- tools/llvm-mca/Components/BackendPrinter.h +++ tools/llvm-mca/Components/BackendPrinter.h @@ -18,7 +18,7 @@ #define LLVM_TOOLS_LLVM_MCA_BACKENDPRINTER_H #include "Backend.h" -#include "View.h" +#include "Views/View.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/raw_ostream.h" Index: tools/llvm-mca/Components/BackendPrinter.cpp =================================================================== --- tools/llvm-mca/Components/BackendPrinter.cpp +++ tools/llvm-mca/Components/BackendPrinter.cpp @@ -13,7 +13,6 @@ //===----------------------------------------------------------------------===// #include "BackendPrinter.h" -#include "View.h" #include "llvm/CodeGen/TargetSchedule.h" namespace mca { Index: tools/llvm-mca/Components/CMakeLists.txt =================================================================== --- /dev/null +++ tools/llvm-mca/Components/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) + +add_llvm_library(LLVMMCAComponents + Backend.cpp + BackendPrinter.cpp + Instruction.cpp + InstructionTables.cpp + LSUnit.cpp + RegisterFile.cpp + RegisterFileStatistics.cpp + RetireControlUnit.cpp + RetireControlUnitStatistics.cpp + Scheduler.cpp + SchedulerStatistics.cpp + ) Index: tools/llvm-mca/Components/InstructionTables.h =================================================================== --- tools/llvm-mca/Components/InstructionTables.h +++ tools/llvm-mca/Components/InstructionTables.h @@ -17,9 +17,9 @@ #ifndef LLVM_TOOLS_LLVM_MCA_INSTRUCTIONTABLES_H #define LLVM_TOOLS_LLVM_MCA_INSTRUCTIONTABLES_H -#include "View.h" -#include "InstrBuilder.h" -#include "SourceMgr.h" +#include "Utils/InstrBuilder.h" +#include "Utils/SourceMgr.h" +#include "Views/View.h" #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSchedule.h" Index: tools/llvm-mca/Components/RegisterFileStatistics.h =================================================================== --- tools/llvm-mca/Components/RegisterFileStatistics.h +++ tools/llvm-mca/Components/RegisterFileStatistics.h @@ -32,7 +32,7 @@ #ifndef LLVM_TOOLS_LLVM_MCA_REGISTERFILESTATISTICS_H #define LLVM_TOOLS_LLVM_MCA_REGISTERFILESTATISTICS_H -#include "View.h" +#include "Views/View.h" #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSubtargetInfo.h" Index: tools/llvm-mca/Components/RetireControlUnit.cpp =================================================================== --- tools/llvm-mca/Components/RetireControlUnit.cpp +++ tools/llvm-mca/Components/RetireControlUnit.cpp @@ -13,7 +13,6 @@ //===----------------------------------------------------------------------===// #include "RetireControlUnit.h" -#include "DispatchStage.h" #include "llvm/Support/Debug.h" using namespace llvm; Index: tools/llvm-mca/Components/RetireControlUnitStatistics.h =================================================================== --- tools/llvm-mca/Components/RetireControlUnitStatistics.h +++ tools/llvm-mca/Components/RetireControlUnitStatistics.h @@ -26,7 +26,7 @@ #ifndef LLVM_TOOLS_LLVM_MCA_RETIRECONTROLUNITSTATISTICS_H #define LLVM_TOOLS_LLVM_MCA_RETIRECONTROLUNITSTATISTICS_H -#include "View.h" +#include "Views/View.h" #include "llvm/ADT/DenseMap.h" #include "llvm/MC/MCSubtargetInfo.h" Index: tools/llvm-mca/Components/Scheduler.h =================================================================== --- tools/llvm-mca/Components/Scheduler.h +++ tools/llvm-mca/Components/Scheduler.h @@ -15,10 +15,10 @@ #ifndef LLVM_TOOLS_LLVM_MCA_SCHEDULER_H #define LLVM_TOOLS_LLVM_MCA_SCHEDULER_H -#include "HWEventListener.h" #include "Instruction.h" #include "LSUnit.h" #include "RetireControlUnit.h" +#include "Utils/HWEventListener.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" Index: tools/llvm-mca/Components/Scheduler.cpp =================================================================== --- tools/llvm-mca/Components/Scheduler.cpp +++ tools/llvm-mca/Components/Scheduler.cpp @@ -13,8 +13,8 @@ #include "Scheduler.h" #include "Backend.h" -#include "HWEventListener.h" -#include "Support.h" +#include "Utils/HWEventListener.h" +#include "Utils/Support.h" #include "llvm/Support/raw_ostream.h" namespace mca { Index: tools/llvm-mca/Components/SchedulerStatistics.h =================================================================== --- tools/llvm-mca/Components/SchedulerStatistics.h +++ tools/llvm-mca/Components/SchedulerStatistics.h @@ -31,9 +31,9 @@ #ifndef LLVM_TOOLS_LLVM_MCA_SCHEDULERSTATISTICS_H #define LLVM_TOOLS_LLVM_MCA_SCHEDULERSTATISTICS_H -#include "View.h" -#include "llvm/ADT/SmallVector.h" +#include "Views/View.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSubtargetInfo.h" namespace mca { Index: tools/llvm-mca/Stages/CMakeLists.txt =================================================================== --- /dev/null +++ tools/llvm-mca/Stages/CMakeLists.txt @@ -0,0 +1,10 @@ +include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) + +add_llvm_library(LLVMMCAStages + DispatchStage.cpp + DispatchStatistics.cpp + ExecuteStage.cpp + FetchStage.cpp + RetireStage.cpp + Stage.cpp + ) Index: tools/llvm-mca/Stages/DispatchStage.h =================================================================== --- tools/llvm-mca/Stages/DispatchStage.h +++ tools/llvm-mca/Stages/DispatchStage.h @@ -19,9 +19,9 @@ #ifndef LLVM_TOOLS_LLVM_MCA_DISPATCH_STAGE_H #define LLVM_TOOLS_LLVM_MCA_DISPATCH_STAGE_H -#include "Instruction.h" -#include "RegisterFile.h" -#include "RetireControlUnit.h" +#include "Components/Instruction.h" +#include "Components/RegisterFile.h" +#include "Components/RetireControlUnit.h" #include "Stage.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" Index: tools/llvm-mca/Stages/DispatchStage.cpp =================================================================== --- tools/llvm-mca/Stages/DispatchStage.cpp +++ tools/llvm-mca/Stages/DispatchStage.cpp @@ -17,9 +17,9 @@ //===----------------------------------------------------------------------===// #include "DispatchStage.h" -#include "Backend.h" -#include "HWEventListener.h" -#include "Scheduler.h" +#include "Components/Backend.h" +#include "Components/Scheduler.h" +#include "Utils/HWEventListener.h" #include "llvm/Support/Debug.h" using namespace llvm; Index: tools/llvm-mca/Stages/DispatchStatistics.h =================================================================== --- tools/llvm-mca/Stages/DispatchStatistics.h +++ tools/llvm-mca/Stages/DispatchStatistics.h @@ -34,7 +34,7 @@ #ifndef LLVM_TOOLS_LLVM_MCA_DISPATCHVIEW_H #define LLVM_TOOLS_LLVM_MCA_DISPATCHVIEW_H -#include "View.h" +#include "Views/View.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSubtargetInfo.h" Index: tools/llvm-mca/Stages/ExecuteStage.h =================================================================== --- tools/llvm-mca/Stages/ExecuteStage.h +++ tools/llvm-mca/Stages/ExecuteStage.h @@ -18,9 +18,9 @@ #ifndef LLVM_TOOLS_LLVM_MCA_EXECUTE_STAGE_H #define LLVM_TOOLS_LLVM_MCA_EXECUTE_STAGE_H -#include "Instruction.h" -#include "RetireControlUnit.h" -#include "Scheduler.h" +#include "Components/Instruction.h" +#include "Components/RetireControlUnit.h" +#include "Components/Scheduler.h" #include "Stage.h" #include "llvm/ADT/ArrayRef.h" Index: tools/llvm-mca/Stages/ExecuteStage.cpp =================================================================== --- tools/llvm-mca/Stages/ExecuteStage.cpp +++ tools/llvm-mca/Stages/ExecuteStage.cpp @@ -16,8 +16,8 @@ //===----------------------------------------------------------------------===// #include "ExecuteStage.h" -#include "Backend.h" -#include "Scheduler.h" +#include "Components/Backend.h" +#include "Components/Scheduler.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Debug.h" Index: tools/llvm-mca/Stages/FetchStage.h =================================================================== --- tools/llvm-mca/Stages/FetchStage.h +++ tools/llvm-mca/Stages/FetchStage.h @@ -16,9 +16,9 @@ #ifndef LLVM_TOOLS_LLVM_MCA_FETCH_STAGE_H #define LLVM_TOOLS_LLVM_MCA_FETCH_STAGE_H -#include "InstrBuilder.h" -#include "SourceMgr.h" #include "Stage.h" +#include "Utils/InstrBuilder.h" +#include "Utils/SourceMgr.h" #include namespace mca { Index: tools/llvm-mca/Stages/RetireStage.h =================================================================== --- tools/llvm-mca/Stages/RetireStage.h +++ tools/llvm-mca/Stages/RetireStage.h @@ -17,8 +17,8 @@ #ifndef LLVM_TOOLS_LLVM_MCA_RETIRE_STAGE_H #define LLVM_TOOLS_LLVM_MCA_RETIRE_STAGE_H -#include "RegisterFile.h" -#include "RetireControlUnit.h" +#include "Components/RegisterFile.h" +#include "Components/RetireControlUnit.h" #include "Stage.h" namespace mca { Index: tools/llvm-mca/Stages/RetireStage.cpp =================================================================== --- tools/llvm-mca/Stages/RetireStage.cpp +++ tools/llvm-mca/Stages/RetireStage.cpp @@ -15,8 +15,8 @@ //===----------------------------------------------------------------------===// #include "RetireStage.h" -#include "Backend.h" -#include "HWEventListener.h" +#include "Components/Backend.h" +#include "Utils/HWEventListener.h" #include "llvm/Support/Debug.h" using namespace llvm; Index: tools/llvm-mca/Utils/CMakeLists.txt =================================================================== --- /dev/null +++ tools/llvm-mca/Utils/CMakeLists.txt @@ -0,0 +1,9 @@ +include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) + +add_llvm_library(LLVMMCAUtils + CodeRegion.cpp + CodeRegion.h + HWEventListener.cpp + InstrBuilder.cpp + Support.cpp + ) Index: tools/llvm-mca/Utils/HWEventListener.h =================================================================== --- tools/llvm-mca/Utils/HWEventListener.h +++ tools/llvm-mca/Utils/HWEventListener.h @@ -15,7 +15,7 @@ #ifndef LLVM_TOOLS_LLVM_MCA_HWEVENTLISTENER_H #define LLVM_TOOLS_LLVM_MCA_HWEVENTLISTENER_H -#include "Instruction.h" +#include "Components/Instruction.h" #include "llvm/ADT/ArrayRef.h" #include Index: tools/llvm-mca/Utils/InstrBuilder.h =================================================================== --- tools/llvm-mca/Utils/InstrBuilder.h +++ tools/llvm-mca/Utils/InstrBuilder.h @@ -15,7 +15,7 @@ #ifndef LLVM_TOOLS_LLVM_MCA_INSTRBUILDER_H #define LLVM_TOOLS_LLVM_MCA_INSTRBUILDER_H -#include "Instruction.h" +#include "Components/Instruction.h" #include "Support.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCSubtargetInfo.h" Index: tools/llvm-mca/Views/CMakeLists.txt =================================================================== --- /dev/null +++ tools/llvm-mca/Views/CMakeLists.txt @@ -0,0 +1,9 @@ +include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) + +add_llvm_library(LLVMMCAViews + InstructionInfoView.cpp + ResourcePressureView.cpp + SummaryView.cpp + TimelineView.cpp + View.cpp + ) Index: tools/llvm-mca/Views/InstructionInfoView.h =================================================================== --- tools/llvm-mca/Views/InstructionInfoView.h +++ tools/llvm-mca/Views/InstructionInfoView.h @@ -35,7 +35,7 @@ #ifndef LLVM_TOOLS_LLVM_MCA_INSTRUCTIONINFOVIEW_H #define LLVM_TOOLS_LLVM_MCA_INSTRUCTIONINFOVIEW_H -#include "SourceMgr.h" +#include "Utils/SourceMgr.h" #include "View.h" #include "llvm/MC/MCInstPrinter.h" #include "llvm/MC/MCInstrInfo.h" Index: tools/llvm-mca/Views/ResourcePressureView.h =================================================================== --- tools/llvm-mca/Views/ResourcePressureView.h +++ tools/llvm-mca/Views/ResourcePressureView.h @@ -58,7 +58,7 @@ #ifndef LLVM_TOOLS_LLVM_MCA_RESOURCEPRESSUREVIEW_H #define LLVM_TOOLS_LLVM_MCA_RESOURCEPRESSUREVIEW_H -#include "SourceMgr.h" +#include "Utils/SourceMgr.h" #include "View.h" #include "llvm/ADT/DenseMap.h" #include "llvm/MC/MCInstPrinter.h" Index: tools/llvm-mca/Views/SummaryView.h =================================================================== --- tools/llvm-mca/Views/SummaryView.h +++ tools/llvm-mca/Views/SummaryView.h @@ -29,7 +29,7 @@ #ifndef LLVM_TOOLS_LLVM_MCA_SUMMARYVIEW_H #define LLVM_TOOLS_LLVM_MCA_SUMMARYVIEW_H -#include "SourceMgr.h" +#include "Utils/SourceMgr.h" #include "View.h" #include "llvm/ADT/DenseMap.h" #include "llvm/MC/MCSchedule.h" Index: tools/llvm-mca/Views/SummaryView.cpp =================================================================== --- tools/llvm-mca/Views/SummaryView.cpp +++ tools/llvm-mca/Views/SummaryView.cpp @@ -14,7 +14,7 @@ //===----------------------------------------------------------------------===// #include "SummaryView.h" -#include "Support.h" +#include "Utils/Support.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Format.h" Index: tools/llvm-mca/Views/TimelineView.h =================================================================== --- tools/llvm-mca/Views/TimelineView.h +++ tools/llvm-mca/Views/TimelineView.h @@ -100,7 +100,7 @@ #ifndef LLVM_TOOLS_LLVM_MCA_TIMELINEVIEW_H #define LLVM_TOOLS_LLVM_MCA_TIMELINEVIEW_H -#include "SourceMgr.h" +#include "Utils/SourceMgr.h" #include "View.h" #include "llvm/MC/MCInstPrinter.h" #include "llvm/MC/MCSubtargetInfo.h" Index: tools/llvm-mca/Views/View.h =================================================================== --- tools/llvm-mca/Views/View.h +++ tools/llvm-mca/Views/View.h @@ -16,7 +16,7 @@ #ifndef LLVM_TOOLS_LLVM_MCA_VIEW_H #define LLVM_TOOLS_LLVM_MCA_VIEW_H -#include "HWEventListener.h" +#include "Utils/HWEventListener.h" #include "llvm/Support/raw_ostream.h" namespace mca { Index: tools/llvm-mca/llvm-mca.cpp =================================================================== --- tools/llvm-mca/llvm-mca.cpp +++ tools/llvm-mca/llvm-mca.cpp @@ -21,18 +21,18 @@ // //===----------------------------------------------------------------------===// -#include "BackendPrinter.h" -#include "CodeRegion.h" -#include "DispatchStatistics.h" -#include "FetchStage.h" -#include "InstructionInfoView.h" -#include "InstructionTables.h" -#include "RegisterFileStatistics.h" -#include "ResourcePressureView.h" -#include "RetireControlUnitStatistics.h" -#include "SchedulerStatistics.h" -#include "SummaryView.h" -#include "TimelineView.h" +#include "Components/BackendPrinter.h" +#include "Components/InstructionTables.h" +#include "Components/RegisterFileStatistics.h" +#include "Components/RetireControlUnitStatistics.h" +#include "Components/SchedulerStatistics.h" +#include "Stages/DispatchStatistics.h" +#include "Stages/FetchStage.h" +#include "Utils/CodeRegion.h" +#include "Views/InstructionInfoView.h" +#include "Views/ResourcePressureView.h" +#include "Views/SummaryView.h" +#include "Views/TimelineView.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCObjectFileInfo.h"