From: Clement Courbet Date: Mon, 17 Dec 2018 08:08:31 +0000 (+0000) Subject: [llvm-mca] Move llvm-mca library to llvm/lib/MCA. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8178ac881e1073067643abe6126306dfc7ec24ff;p=llvm [llvm-mca] Move llvm-mca library to llvm/lib/MCA. Summary: See PR38731. Reviewers: andreadb Subscribers: mgorny, javed.absar, tschuett, gbedwell, andreadb, RKSimon, llvm-commits Differential Revision: https://reviews.llvm.org/D55557 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349332 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/CODE_OWNERS.TXT b/CODE_OWNERS.TXT index 67b91f20883..a6e10fc0e27 100644 --- a/CODE_OWNERS.TXT +++ b/CODE_OWNERS.TXT @@ -71,7 +71,7 @@ D: Loop Strength Reduction, Register allocators N: Andrea Di Biagio E: andrea.dibiagio@sony.com E: andrea.dibiagio@gmail.com -D: llvm-mca +D: MCA, llvm-mca N: Duncan P. N. Exon Smith E: dexonsmith@apple.com diff --git a/tools/llvm-mca/include/Context.h b/include/llvm/MCA/Context.h similarity index 90% rename from tools/llvm-mca/include/Context.h rename to include/llvm/MCA/Context.h index ebd1528e371..6b2bee0fdc4 100644 --- a/tools/llvm-mca/include/Context.h +++ b/include/llvm/MCA/Context.h @@ -15,14 +15,15 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_CONTEXT_H -#define LLVM_TOOLS_LLVM_MCA_CONTEXT_H -#include "HardwareUnits/HardwareUnit.h" -#include "InstrBuilder.h" -#include "Pipeline.h" -#include "SourceMgr.h" +#ifndef LLVM_MCA_CONTEXT_H +#define LLVM_MCA_CONTEXT_H + #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" +#include "llvm/MCA/HardwareUnits/HardwareUnit.h" +#include "llvm/MCA/InstrBuilder.h" +#include "llvm/MCA/Pipeline.h" +#include "llvm/MCA/SourceMgr.h" #include namespace llvm { @@ -65,4 +66,4 @@ public: } // namespace mca } // namespace llvm -#endif // LLVM_TOOLS_LLVM_MCA_CONTEXT_H +#endif // LLVM_MCA_CONTEXT_H diff --git a/tools/llvm-mca/include/HWEventListener.h b/include/llvm/MCA/HWEventListener.h similarity index 96% rename from tools/llvm-mca/include/HWEventListener.h rename to include/llvm/MCA/HWEventListener.h index 0216fae7866..3b32b2cd657 100644 --- a/tools/llvm-mca/include/HWEventListener.h +++ b/include/llvm/MCA/HWEventListener.h @@ -12,12 +12,12 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_HWEVENTLISTENER_H -#define LLVM_TOOLS_LLVM_MCA_HWEVENTLISTENER_H +#ifndef LLVM_MCA_HWEVENTLISTENER_H +#define LLVM_MCA_HWEVENTLISTENER_H -#include "Instruction.h" -#include "Support.h" #include "llvm/ADT/ArrayRef.h" +#include "llvm/MCA/Instruction.h" +#include "llvm/MCA/Support.h" namespace llvm { namespace mca { @@ -153,4 +153,4 @@ private: } // namespace mca } // namespace llvm -#endif +#endif // LLVM_MCA_HWEVENTLISTENER_H diff --git a/tools/llvm-mca/include/HardwareUnits/HardwareUnit.h b/include/llvm/MCA/HardwareUnits/HardwareUnit.h similarity index 86% rename from tools/llvm-mca/include/HardwareUnits/HardwareUnit.h rename to include/llvm/MCA/HardwareUnits/HardwareUnit.h index 5070418c11b..104a2009f21 100644 --- a/tools/llvm-mca/include/HardwareUnits/HardwareUnit.h +++ b/include/llvm/MCA/HardwareUnits/HardwareUnit.h @@ -13,8 +13,8 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_HARDWAREUNIT_H -#define LLVM_TOOLS_LLVM_MCA_HARDWAREUNIT_H +#ifndef LLVM_MCA_HARDWAREUNIT_H +#define LLVM_MCA_HARDWAREUNIT_H namespace llvm { namespace mca { @@ -30,4 +30,4 @@ public: } // namespace mca } // namespace llvm -#endif // LLVM_TOOLS_LLVM_MCA_HARDWAREUNIT_H +#endif // LLVM_MCA_HARDWAREUNIT_H diff --git a/tools/llvm-mca/include/HardwareUnits/LSUnit.h b/include/llvm/MCA/HardwareUnits/LSUnit.h similarity index 98% rename from tools/llvm-mca/include/HardwareUnits/LSUnit.h rename to include/llvm/MCA/HardwareUnits/LSUnit.h index 3f37651ad8d..e217fc50f78 100644 --- a/tools/llvm-mca/include/HardwareUnits/LSUnit.h +++ b/include/llvm/MCA/HardwareUnits/LSUnit.h @@ -13,12 +13,12 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_LSUNIT_H -#define LLVM_TOOLS_LLVM_MCA_LSUNIT_H +#ifndef LLVM_MCA_LSUNIT_H +#define LLVM_MCA_LSUNIT_H -#include "HardwareUnits/HardwareUnit.h" #include "llvm/ADT/SmallSet.h" #include "llvm/MC/MCSchedule.h" +#include "llvm/MCA/HardwareUnits/HardwareUnit.h" namespace llvm { namespace mca { @@ -204,4 +204,4 @@ public: } // namespace mca } // namespace llvm -#endif +#endif // LLVM_MCA_LSUNIT_H diff --git a/tools/llvm-mca/include/HardwareUnits/RegisterFile.h b/include/llvm/MCA/HardwareUnits/RegisterFile.h similarity index 98% rename from tools/llvm-mca/include/HardwareUnits/RegisterFile.h rename to include/llvm/MCA/HardwareUnits/RegisterFile.h index d9949bf4f6a..c23ab038923 100644 --- a/tools/llvm-mca/include/HardwareUnits/RegisterFile.h +++ b/include/llvm/MCA/HardwareUnits/RegisterFile.h @@ -14,14 +14,14 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_REGISTER_FILE_H -#define LLVM_TOOLS_LLVM_MCA_REGISTER_FILE_H +#ifndef LLVM_MCA_REGISTER_FILE_H +#define LLVM_MCA_REGISTER_FILE_H -#include "HardwareUnits/HardwareUnit.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSchedule.h" +#include "llvm/MCA/HardwareUnits/HardwareUnit.h" #include "llvm/Support/Error.h" namespace llvm { @@ -236,4 +236,4 @@ public: } // namespace mca } // namespace llvm -#endif // LLVM_TOOLS_LLVM_MCA_REGISTER_FILE_H +#endif // LLVM_MCA_REGISTER_FILE_H diff --git a/tools/llvm-mca/include/HardwareUnits/ResourceManager.h b/include/llvm/MCA/HardwareUnits/ResourceManager.h similarity index 98% rename from tools/llvm-mca/include/HardwareUnits/ResourceManager.h rename to include/llvm/MCA/HardwareUnits/ResourceManager.h index aa1bdb0440f..5429f2b8cf0 100644 --- a/tools/llvm-mca/include/HardwareUnits/ResourceManager.h +++ b/include/llvm/MCA/HardwareUnits/ResourceManager.h @@ -13,15 +13,15 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_RESOURCE_MANAGER_H -#define LLVM_TOOLS_LLVM_MCA_RESOURCE_MANAGER_H +#ifndef LLVM_MCA_RESOURCE_MANAGER_H +#define LLVM_MCA_RESOURCE_MANAGER_H -#include "Instruction.h" -#include "Support.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSchedule.h" +#include "llvm/MCA/Instruction.h" +#include "llvm/MCA/Support.h" namespace llvm { namespace mca { @@ -357,4 +357,4 @@ public: } // namespace mca } // namespace llvm -#endif // LLVM_TOOLS_LLVM_MCA_RESOURCE_MANAGER_H +#endif // LLVM_MCA_RESOURCE_MANAGER_H diff --git a/tools/llvm-mca/include/HardwareUnits/RetireControlUnit.h b/include/llvm/MCA/HardwareUnits/RetireControlUnit.h similarity index 94% rename from tools/llvm-mca/include/HardwareUnits/RetireControlUnit.h rename to include/llvm/MCA/HardwareUnits/RetireControlUnit.h index 12e0a1fba13..71360e984ad 100644 --- a/tools/llvm-mca/include/HardwareUnits/RetireControlUnit.h +++ b/include/llvm/MCA/HardwareUnits/RetireControlUnit.h @@ -12,12 +12,12 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_RETIRE_CONTROL_UNIT_H -#define LLVM_TOOLS_LLVM_MCA_RETIRE_CONTROL_UNIT_H +#ifndef LLVM_MCA_RETIRE_CONTROL_UNIT_H +#define LLVM_MCA_RETIRE_CONTROL_UNIT_H -#include "HardwareUnits/HardwareUnit.h" -#include "Instruction.h" #include "llvm/MC/MCSchedule.h" +#include "llvm/MCA/HardwareUnits/HardwareUnit.h" +#include "llvm/MCA/Instruction.h" #include namespace llvm { @@ -101,4 +101,4 @@ public: } // namespace mca } // namespace llvm -#endif // LLVM_TOOLS_LLVM_MCA_RETIRE_CONTROL_UNIT_H +#endif // LLVM_MCA_RETIRE_CONTROL_UNIT_H diff --git a/tools/llvm-mca/include/HardwareUnits/Scheduler.h b/include/llvm/MCA/HardwareUnits/Scheduler.h similarity index 96% rename from tools/llvm-mca/include/HardwareUnits/Scheduler.h rename to include/llvm/MCA/HardwareUnits/Scheduler.h index a8d00d2a60c..351ea4827df 100644 --- a/tools/llvm-mca/include/HardwareUnits/Scheduler.h +++ b/include/llvm/MCA/HardwareUnits/Scheduler.h @@ -12,15 +12,15 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_SCHEDULER_H -#define LLVM_TOOLS_LLVM_MCA_SCHEDULER_H +#ifndef LLVM_MCA_SCHEDULER_H +#define LLVM_MCA_SCHEDULER_H -#include "HardwareUnits/HardwareUnit.h" -#include "HardwareUnits/LSUnit.h" -#include "ResourceManager.h" -#include "Support.h" #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSchedule.h" +#include "llvm/MCA/HardwareUnits/HardwareUnit.h" +#include "llvm/MCA/HardwareUnits/LSUnit.h" +#include "llvm/MCA/HardwareUnits/ResourceManager.h" +#include "llvm/MCA/Support.h" namespace llvm { namespace mca { @@ -211,4 +211,4 @@ public: } // namespace mca } // namespace llvm -#endif // LLVM_TOOLS_LLVM_MCA_SCHEDULER_H +#endif // LLVM_MCA_SCHEDULER_H diff --git a/tools/llvm-mca/include/InstrBuilder.h b/include/llvm/MCA/InstrBuilder.h similarity index 94% rename from tools/llvm-mca/include/InstrBuilder.h rename to include/llvm/MCA/InstrBuilder.h index 1c958c5020e..0fadbce399b 100644 --- a/tools/llvm-mca/include/InstrBuilder.h +++ b/include/llvm/MCA/InstrBuilder.h @@ -12,15 +12,15 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_INSTRBUILDER_H -#define LLVM_TOOLS_LLVM_MCA_INSTRBUILDER_H +#ifndef LLVM_MCA_INSTRBUILDER_H +#define LLVM_MCA_INSTRBUILDER_H -#include "Instruction.h" -#include "Support.h" #include "llvm/MC/MCInstrAnalysis.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" +#include "llvm/MCA/Instruction.h" +#include "llvm/MCA/Support.h" #include "llvm/Support/Error.h" namespace llvm { @@ -74,4 +74,4 @@ public: } // namespace mca } // namespace llvm -#endif +#endif // LLVM_MCA_INSTRBUILDER_H diff --git a/tools/llvm-mca/include/Instruction.h b/include/llvm/MCA/Instruction.h similarity index 99% rename from tools/llvm-mca/include/Instruction.h rename to include/llvm/MCA/Instruction.h index dff9513f821..d3fa8ccdc93 100644 --- a/tools/llvm-mca/include/Instruction.h +++ b/include/llvm/MCA/Instruction.h @@ -13,8 +13,8 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_INSTRUCTION_H -#define LLVM_TOOLS_LLVM_MCA_INSTRUCTION_H +#ifndef LLVM_MCA_INSTRUCTION_H +#define LLVM_MCA_INSTRUCTION_H #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/STLExtras.h" @@ -539,4 +539,4 @@ public: } // namespace mca } // namespace llvm -#endif +#endif // LLVM_MCA_INSTRUCTION_H diff --git a/tools/llvm-mca/include/Pipeline.h b/include/llvm/MCA/Pipeline.h similarity index 93% rename from tools/llvm-mca/include/Pipeline.h rename to include/llvm/MCA/Pipeline.h index 0fd40264569..acd256060bd 100644 --- a/tools/llvm-mca/include/Pipeline.h +++ b/include/llvm/MCA/Pipeline.h @@ -13,12 +13,12 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_PIPELINE_H -#define LLVM_TOOLS_LLVM_MCA_PIPELINE_H +#ifndef LLVM_MCA_PIPELINE_H +#define LLVM_MCA_PIPELINE_H -#include "HardwareUnits/Scheduler.h" -#include "Stages/Stage.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/MCA/HardwareUnits/Scheduler.h" +#include "llvm/MCA/Stages/Stage.h" #include "llvm/Support/Error.h" namespace llvm { @@ -76,4 +76,4 @@ public: } // namespace mca } // namespace llvm -#endif // LLVM_TOOLS_LLVM_MCA_PIPELINE_H +#endif // LLVM_MCA_PIPELINE_H diff --git a/tools/llvm-mca/include/SourceMgr.h b/include/llvm/MCA/SourceMgr.h similarity index 95% rename from tools/llvm-mca/include/SourceMgr.h rename to include/llvm/MCA/SourceMgr.h index e5180107011..5e0ca6419f5 100644 --- a/tools/llvm-mca/include/SourceMgr.h +++ b/include/llvm/MCA/SourceMgr.h @@ -13,8 +13,8 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_SOURCEMGR_H -#define LLVM_TOOLS_LLVM_MCA_SOURCEMGR_H +#ifndef LLVM_MCA_SOURCEMGR_H +#define LLVM_MCA_SOURCEMGR_H #include "llvm/ADT/ArrayRef.h" @@ -54,4 +54,4 @@ public: } // namespace mca } // namespace llvm -#endif +#endif // LLVM_MCA_SOURCEMGR_H diff --git a/tools/llvm-mca/include/Stages/DispatchStage.h b/include/llvm/MCA/Stages/DispatchStage.h similarity index 91% rename from tools/llvm-mca/include/Stages/DispatchStage.h rename to include/llvm/MCA/Stages/DispatchStage.h index 29cace1022e..f015cd7522e 100644 --- a/tools/llvm-mca/include/Stages/DispatchStage.h +++ b/include/llvm/MCA/Stages/DispatchStage.h @@ -16,16 +16,16 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_DISPATCH_STAGE_H -#define LLVM_TOOLS_LLVM_MCA_DISPATCH_STAGE_H +#ifndef LLVM_MCA_DISPATCH_STAGE_H +#define LLVM_MCA_DISPATCH_STAGE_H -#include "HWEventListener.h" -#include "HardwareUnits/RegisterFile.h" -#include "HardwareUnits/RetireControlUnit.h" -#include "Instruction.h" -#include "Stages/Stage.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" +#include "llvm/MCA/HWEventListener.h" +#include "llvm/MCA/HardwareUnits/RegisterFile.h" +#include "llvm/MCA/HardwareUnits/RetireControlUnit.h" +#include "llvm/MCA/Instruction.h" +#include "llvm/MCA/Stages/Stage.h" namespace llvm { namespace mca { @@ -90,4 +90,4 @@ public: } // namespace mca } // namespace llvm -#endif // LLVM_TOOLS_LLVM_MCA_DISPATCH_STAGE_H +#endif // LLVM_MCA_DISPATCH_STAGE_H diff --git a/tools/llvm-mca/include/Stages/EntryStage.h b/include/llvm/MCA/Stages/EntryStage.h similarity index 88% rename from tools/llvm-mca/include/Stages/EntryStage.h rename to include/llvm/MCA/Stages/EntryStage.h index 21b8331e95b..cd9a65b8cc2 100644 --- a/tools/llvm-mca/include/Stages/EntryStage.h +++ b/include/llvm/MCA/Stages/EntryStage.h @@ -14,12 +14,12 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_ENTRY_STAGE_H -#define LLVM_TOOLS_LLVM_MCA_ENTRY_STAGE_H +#ifndef LLVM_MCA_ENTRY_STAGE_H +#define LLVM_MCA_ENTRY_STAGE_H -#include "SourceMgr.h" -#include "Stages/Stage.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/MCA/SourceMgr.h" +#include "llvm/MCA/Stages/Stage.h" namespace llvm { namespace mca { @@ -49,4 +49,4 @@ public: } // namespace mca } // namespace llvm -#endif // LLVM_TOOLS_LLVM_MCA_FETCH_STAGE_H +#endif // LLVM_MCA_FETCH_STAGE_H diff --git a/tools/llvm-mca/include/Stages/ExecuteStage.h b/include/llvm/MCA/Stages/ExecuteStage.h similarity index 92% rename from tools/llvm-mca/include/Stages/ExecuteStage.h rename to include/llvm/MCA/Stages/ExecuteStage.h index 91b24059c95..4f40c5c65d6 100644 --- a/tools/llvm-mca/include/Stages/ExecuteStage.h +++ b/include/llvm/MCA/Stages/ExecuteStage.h @@ -15,13 +15,13 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_EXECUTE_STAGE_H -#define LLVM_TOOLS_LLVM_MCA_EXECUTE_STAGE_H +#ifndef LLVM_MCA_EXECUTE_STAGE_H +#define LLVM_MCA_EXECUTE_STAGE_H -#include "HardwareUnits/Scheduler.h" -#include "Instruction.h" -#include "Stages/Stage.h" #include "llvm/ADT/ArrayRef.h" +#include "llvm/MCA/HardwareUnits/Scheduler.h" +#include "llvm/MCA/Instruction.h" +#include "llvm/MCA/Stages/Stage.h" namespace llvm { namespace mca { @@ -77,4 +77,4 @@ public: } // namespace mca } // namespace llvm -#endif // LLVM_TOOLS_LLVM_MCA_EXECUTE_STAGE_H +#endif // LLVM_MCA_EXECUTE_STAGE_H diff --git a/tools/llvm-mca/include/Stages/InstructionTables.h b/include/llvm/MCA/Stages/InstructionTables.h similarity index 83% rename from tools/llvm-mca/include/Stages/InstructionTables.h rename to include/llvm/MCA/Stages/InstructionTables.h index e618d06b1b7..50f84fc6fff 100644 --- a/tools/llvm-mca/include/Stages/InstructionTables.h +++ b/include/llvm/MCA/Stages/InstructionTables.h @@ -14,14 +14,14 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_INSTRUCTIONTABLES_H -#define LLVM_TOOLS_LLVM_MCA_INSTRUCTIONTABLES_H +#ifndef LLVM_MCA_INSTRUCTIONTABLES_H +#define LLVM_MCA_INSTRUCTIONTABLES_H -#include "HardwareUnits/Scheduler.h" -#include "Stages/Stage.h" -#include "Support.h" #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSchedule.h" +#include "llvm/MCA/HardwareUnits/Scheduler.h" +#include "llvm/MCA/Stages/Stage.h" +#include "llvm/MCA/Support.h" namespace llvm { namespace mca { @@ -42,4 +42,4 @@ public: } // namespace mca } // namespace llvm -#endif +#endif // LLVM_MCA_INSTRUCTIONTABLES_H diff --git a/tools/llvm-mca/include/Stages/RetireStage.h b/include/llvm/MCA/Stages/RetireStage.h similarity index 84% rename from tools/llvm-mca/include/Stages/RetireStage.h rename to include/llvm/MCA/Stages/RetireStage.h index 28eda40984f..2051ce5c86a 100644 --- a/tools/llvm-mca/include/Stages/RetireStage.h +++ b/include/llvm/MCA/Stages/RetireStage.h @@ -14,12 +14,12 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_RETIRE_STAGE_H -#define LLVM_TOOLS_LLVM_MCA_RETIRE_STAGE_H +#ifndef LLVM_MCA_RETIRE_STAGE_H +#define LLVM_MCA_RETIRE_STAGE_H -#include "HardwareUnits/RegisterFile.h" -#include "HardwareUnits/RetireControlUnit.h" -#include "Stages/Stage.h" +#include "llvm/MCA/HardwareUnits/RegisterFile.h" +#include "llvm/MCA/HardwareUnits/RetireControlUnit.h" +#include "llvm/MCA/Stages/Stage.h" namespace llvm { namespace mca { @@ -45,4 +45,4 @@ public: } // namespace mca } // namespace llvm -#endif // LLVM_TOOLS_LLVM_MCA_RETIRE_STAGE_H +#endif // LLVM_MCA_RETIRE_STAGE_H diff --git a/tools/llvm-mca/include/Stages/Stage.h b/include/llvm/MCA/Stages/Stage.h similarity index 94% rename from tools/llvm-mca/include/Stages/Stage.h rename to include/llvm/MCA/Stages/Stage.h index 5665fc453bf..fc7ab569bb0 100644 --- a/tools/llvm-mca/include/Stages/Stage.h +++ b/include/llvm/MCA/Stages/Stage.h @@ -13,10 +13,10 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_STAGE_H -#define LLVM_TOOLS_LLVM_MCA_STAGE_H +#ifndef LLVM_MCA_STAGE_H +#define LLVM_MCA_STAGE_H -#include "HWEventListener.h" +#include "llvm/MCA/HWEventListener.h" #include "llvm/Support/Error.h" #include @@ -85,4 +85,4 @@ public: } // namespace mca } // namespace llvm -#endif // LLVM_TOOLS_LLVM_MCA_STAGE_H +#endif // LLVM_MCA_STAGE_H diff --git a/tools/llvm-mca/include/Support.h b/include/llvm/MCA/Support.h similarity index 98% rename from tools/llvm-mca/include/Support.h rename to include/llvm/MCA/Support.h index e7a4e33ed74..5c5a3545433 100644 --- a/tools/llvm-mca/include/Support.h +++ b/include/llvm/MCA/Support.h @@ -12,8 +12,8 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_TOOLS_LLVM_MCA_SUPPORT_H -#define LLVM_TOOLS_LLVM_MCA_SUPPORT_H +#ifndef LLVM_MCA_SUPPORT_H +#define LLVM_MCA_SUPPORT_H #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" @@ -116,4 +116,4 @@ double computeBlockRThroughput(const MCSchedModel &SM, unsigned DispatchWidth, } // namespace mca } // namespace llvm -#endif +#endif // LLVM_MCA_SUPPORT_H diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index d45dc7c4008..f25c7a09855 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -12,6 +12,7 @@ add_subdirectory(Linker) add_subdirectory(Analysis) add_subdirectory(LTO) add_subdirectory(MC) +add_subdirectory(MCA) add_subdirectory(Object) add_subdirectory(ObjectYAML) add_subdirectory(Option) diff --git a/lib/LLVMBuild.txt b/lib/LLVMBuild.txt index 2f6628e318f..d87bf797161 100644 --- a/lib/LLVMBuild.txt +++ b/lib/LLVMBuild.txt @@ -31,6 +31,7 @@ subdirectories = IRReader LTO MC + MCA Object BinaryFormat ObjectYAML diff --git a/tools/llvm-mca/lib/CMakeLists.txt b/lib/MCA/CMakeLists.txt similarity index 62% rename from tools/llvm-mca/lib/CMakeLists.txt rename to lib/MCA/CMakeLists.txt index 21b6e34cc7e..bfd0782d1f7 100644 --- a/tools/llvm-mca/lib/CMakeLists.txt +++ b/lib/MCA/CMakeLists.txt @@ -1,7 +1,4 @@ -include_directories(${LLVM_MCA_SOURCE_DIR}/include) - -add_library(LLVMMCA - STATIC +add_llvm_library(LLVMMCA Context.cpp HWEventListener.cpp HardwareUnits/HardwareUnit.cpp @@ -20,13 +17,7 @@ add_library(LLVMMCA Stages/RetireStage.cpp Stages/Stage.cpp Support.cpp - ) -llvm_update_compile_flags(LLVMMCA) -llvm_map_components_to_libnames(libs - MC - Support + ADDITIONAL_HEADER_DIRS + ${LLVM_MAIN_INCLUDE_DIR}/llvm/MCA ) - -target_link_libraries(LLVMMCA ${libs}) -set_target_properties(LLVMMCA PROPERTIES FOLDER "Libraries") diff --git a/tools/llvm-mca/lib/Context.cpp b/lib/MCA/Context.cpp similarity index 86% rename from tools/llvm-mca/lib/Context.cpp rename to lib/MCA/Context.cpp index 17b992aac9c..c1b197dfe2e 100644 --- a/tools/llvm-mca/lib/Context.cpp +++ b/lib/MCA/Context.cpp @@ -15,14 +15,14 @@ /// //===----------------------------------------------------------------------===// -#include "Context.h" -#include "HardwareUnits/RegisterFile.h" -#include "HardwareUnits/RetireControlUnit.h" -#include "HardwareUnits/Scheduler.h" -#include "Stages/DispatchStage.h" -#include "Stages/EntryStage.h" -#include "Stages/ExecuteStage.h" -#include "Stages/RetireStage.h" +#include "llvm/MCA/Context.h" +#include "llvm/MCA/HardwareUnits/RegisterFile.h" +#include "llvm/MCA/HardwareUnits/RetireControlUnit.h" +#include "llvm/MCA/HardwareUnits/Scheduler.h" +#include "llvm/MCA/Stages/DispatchStage.h" +#include "llvm/MCA/Stages/EntryStage.h" +#include "llvm/MCA/Stages/ExecuteStage.h" +#include "llvm/MCA/Stages/RetireStage.h" namespace llvm { namespace mca { diff --git a/tools/llvm-mca/lib/HWEventListener.cpp b/lib/MCA/HWEventListener.cpp similarity index 94% rename from tools/llvm-mca/lib/HWEventListener.cpp rename to lib/MCA/HWEventListener.cpp index 3930e2555a9..4a0e5b1754d 100644 --- a/tools/llvm-mca/lib/HWEventListener.cpp +++ b/lib/MCA/HWEventListener.cpp @@ -12,7 +12,7 @@ /// //===----------------------------------------------------------------------===// -#include "HWEventListener.h" +#include "llvm/MCA/HWEventListener.h" namespace llvm { namespace mca { diff --git a/tools/llvm-mca/lib/HardwareUnits/HardwareUnit.cpp b/lib/MCA/HardwareUnits/HardwareUnit.cpp similarity index 93% rename from tools/llvm-mca/lib/HardwareUnits/HardwareUnit.cpp rename to lib/MCA/HardwareUnits/HardwareUnit.cpp index 4e46ffacbd4..edd32b9c0c1 100644 --- a/tools/llvm-mca/lib/HardwareUnits/HardwareUnit.cpp +++ b/lib/MCA/HardwareUnits/HardwareUnit.cpp @@ -13,7 +13,7 @@ /// //===----------------------------------------------------------------------===// -#include "HardwareUnits/HardwareUnit.h" +#include "llvm/MCA/HardwareUnits/HardwareUnit.h" namespace llvm { namespace mca { diff --git a/tools/llvm-mca/lib/HardwareUnits/LSUnit.cpp b/lib/MCA/HardwareUnits/LSUnit.cpp similarity index 98% rename from tools/llvm-mca/lib/HardwareUnits/LSUnit.cpp rename to lib/MCA/HardwareUnits/LSUnit.cpp index ed8269167fe..8895eb392b6 100644 --- a/tools/llvm-mca/lib/HardwareUnits/LSUnit.cpp +++ b/lib/MCA/HardwareUnits/LSUnit.cpp @@ -12,8 +12,8 @@ /// //===----------------------------------------------------------------------===// -#include "HardwareUnits/LSUnit.h" -#include "Instruction.h" +#include "llvm/MCA/HardwareUnits/LSUnit.h" +#include "llvm/MCA/Instruction.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" diff --git a/tools/llvm-mca/lib/HardwareUnits/RegisterFile.cpp b/lib/MCA/HardwareUnits/RegisterFile.cpp similarity index 99% rename from tools/llvm-mca/lib/HardwareUnits/RegisterFile.cpp rename to lib/MCA/HardwareUnits/RegisterFile.cpp index f96e4cab4b9..22977e5ded6 100644 --- a/tools/llvm-mca/lib/HardwareUnits/RegisterFile.cpp +++ b/lib/MCA/HardwareUnits/RegisterFile.cpp @@ -14,8 +14,8 @@ /// //===----------------------------------------------------------------------===// -#include "HardwareUnits/RegisterFile.h" -#include "Instruction.h" +#include "llvm/MCA/HardwareUnits/RegisterFile.h" +#include "llvm/MCA/Instruction.h" #include "llvm/Support/Debug.h" #define DEBUG_TYPE "llvm-mca" diff --git a/tools/llvm-mca/lib/HardwareUnits/ResourceManager.cpp b/lib/MCA/HardwareUnits/ResourceManager.cpp similarity index 99% rename from tools/llvm-mca/lib/HardwareUnits/ResourceManager.cpp rename to lib/MCA/HardwareUnits/ResourceManager.cpp index f12238ab801..b62fccdfd28 100644 --- a/tools/llvm-mca/lib/HardwareUnits/ResourceManager.cpp +++ b/lib/MCA/HardwareUnits/ResourceManager.cpp @@ -13,8 +13,8 @@ /// //===----------------------------------------------------------------------===// -#include "HardwareUnits/ResourceManager.h" -#include "Support.h" +#include "llvm/MCA/HardwareUnits/ResourceManager.h" +#include "llvm/MCA/Support.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" @@ -54,7 +54,7 @@ void DefaultResourceStrategy::used(uint64_t Mask) { RemovedFromNextInSequence |= Mask; return; } - + NextInSequenceMask &= (~Mask); if (NextInSequenceMask) return; diff --git a/tools/llvm-mca/lib/HardwareUnits/RetireControlUnit.cpp b/lib/MCA/HardwareUnits/RetireControlUnit.cpp similarity index 98% rename from tools/llvm-mca/lib/HardwareUnits/RetireControlUnit.cpp rename to lib/MCA/HardwareUnits/RetireControlUnit.cpp index bd7b411af11..de9f24552c3 100644 --- a/tools/llvm-mca/lib/HardwareUnits/RetireControlUnit.cpp +++ b/lib/MCA/HardwareUnits/RetireControlUnit.cpp @@ -12,7 +12,7 @@ /// //===----------------------------------------------------------------------===// -#include "HardwareUnits/RetireControlUnit.h" +#include "llvm/MCA/HardwareUnits/RetireControlUnit.h" #include "llvm/Support/Debug.h" #define DEBUG_TYPE "llvm-mca" diff --git a/tools/llvm-mca/lib/HardwareUnits/Scheduler.cpp b/lib/MCA/HardwareUnits/Scheduler.cpp similarity index 99% rename from tools/llvm-mca/lib/HardwareUnits/Scheduler.cpp rename to lib/MCA/HardwareUnits/Scheduler.cpp index f0ac59e5bc2..3924ac59910 100644 --- a/tools/llvm-mca/lib/HardwareUnits/Scheduler.cpp +++ b/lib/MCA/HardwareUnits/Scheduler.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "HardwareUnits/Scheduler.h" +#include "llvm/MCA/HardwareUnits/Scheduler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" diff --git a/tools/llvm-mca/lib/InstrBuilder.cpp b/lib/MCA/InstrBuilder.cpp similarity index 99% rename from tools/llvm-mca/lib/InstrBuilder.cpp rename to lib/MCA/InstrBuilder.cpp index f3960826b5c..5e228a255f1 100644 --- a/tools/llvm-mca/lib/InstrBuilder.cpp +++ b/lib/MCA/InstrBuilder.cpp @@ -12,7 +12,7 @@ /// //===----------------------------------------------------------------------===// -#include "InstrBuilder.h" +#include "llvm/MCA/InstrBuilder.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/DenseMap.h" #include "llvm/MC/MCInst.h" diff --git a/tools/llvm-mca/lib/Instruction.cpp b/lib/MCA/Instruction.cpp similarity index 99% rename from tools/llvm-mca/lib/Instruction.cpp rename to lib/MCA/Instruction.cpp index 47ba2f8043a..057e95ca999 100644 --- a/tools/llvm-mca/lib/Instruction.cpp +++ b/lib/MCA/Instruction.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "Instruction.h" +#include "llvm/MCA/Instruction.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" diff --git a/tools/llvm-mca/lib/LLVMBuild.txt b/lib/MCA/LLVMBuild.txt similarity index 100% rename from tools/llvm-mca/lib/LLVMBuild.txt rename to lib/MCA/LLVMBuild.txt diff --git a/tools/llvm-mca/lib/Pipeline.cpp b/lib/MCA/Pipeline.cpp similarity index 97% rename from tools/llvm-mca/lib/Pipeline.cpp rename to lib/MCA/Pipeline.cpp index 0357124bef5..fd97ea624b8 100644 --- a/tools/llvm-mca/lib/Pipeline.cpp +++ b/lib/MCA/Pipeline.cpp @@ -13,8 +13,8 @@ /// //===----------------------------------------------------------------------===// -#include "Pipeline.h" -#include "HWEventListener.h" +#include "llvm/MCA/Pipeline.h" +#include "llvm/MCA/HWEventListener.h" #include "llvm/Support/Debug.h" namespace llvm { diff --git a/tools/llvm-mca/lib/Stages/DispatchStage.cpp b/lib/MCA/Stages/DispatchStage.cpp similarity index 98% rename from tools/llvm-mca/lib/Stages/DispatchStage.cpp rename to lib/MCA/Stages/DispatchStage.cpp index 838dbad22e3..52e04fad58e 100644 --- a/tools/llvm-mca/lib/Stages/DispatchStage.cpp +++ b/lib/MCA/Stages/DispatchStage.cpp @@ -16,9 +16,9 @@ /// //===----------------------------------------------------------------------===// -#include "Stages/DispatchStage.h" -#include "HWEventListener.h" -#include "HardwareUnits/Scheduler.h" +#include "llvm/MCA/Stages/DispatchStage.h" +#include "llvm/MCA/HWEventListener.h" +#include "llvm/MCA/HardwareUnits/Scheduler.h" #include "llvm/Support/Debug.h" #define DEBUG_TYPE "llvm-mca" diff --git a/tools/llvm-mca/lib/Stages/EntryStage.cpp b/lib/MCA/Stages/EntryStage.cpp similarity index 96% rename from tools/llvm-mca/lib/Stages/EntryStage.cpp rename to lib/MCA/Stages/EntryStage.cpp index f552132cac6..3325bb36f5a 100644 --- a/tools/llvm-mca/lib/Stages/EntryStage.cpp +++ b/lib/MCA/Stages/EntryStage.cpp @@ -13,8 +13,8 @@ /// //===----------------------------------------------------------------------===// -#include "Stages/EntryStage.h" -#include "Instruction.h" +#include "llvm/MCA/Stages/EntryStage.h" +#include "llvm/MCA/Instruction.h" namespace llvm { namespace mca { diff --git a/tools/llvm-mca/lib/Stages/ExecuteStage.cpp b/lib/MCA/Stages/ExecuteStage.cpp similarity index 99% rename from tools/llvm-mca/lib/Stages/ExecuteStage.cpp rename to lib/MCA/Stages/ExecuteStage.cpp index 298f08a2887..17f7ff7259a 100644 --- a/tools/llvm-mca/lib/Stages/ExecuteStage.cpp +++ b/lib/MCA/Stages/ExecuteStage.cpp @@ -15,7 +15,7 @@ /// //===----------------------------------------------------------------------===// -#include "Stages/ExecuteStage.h" +#include "llvm/MCA/Stages/ExecuteStage.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Debug.h" diff --git a/tools/llvm-mca/lib/Stages/InstructionTables.cpp b/lib/MCA/Stages/InstructionTables.cpp similarity index 98% rename from tools/llvm-mca/lib/Stages/InstructionTables.cpp rename to lib/MCA/Stages/InstructionTables.cpp index 33c30e7f95c..f918c183aa5 100644 --- a/tools/llvm-mca/lib/Stages/InstructionTables.cpp +++ b/lib/MCA/Stages/InstructionTables.cpp @@ -15,7 +15,7 @@ /// //===----------------------------------------------------------------------===// -#include "Stages/InstructionTables.h" +#include "llvm/MCA/Stages/InstructionTables.h" namespace llvm { namespace mca { diff --git a/tools/llvm-mca/lib/Stages/RetireStage.cpp b/lib/MCA/Stages/RetireStage.cpp similarity index 95% rename from tools/llvm-mca/lib/Stages/RetireStage.cpp rename to lib/MCA/Stages/RetireStage.cpp index 47eed5f2c9c..d6bcc518662 100644 --- a/tools/llvm-mca/lib/Stages/RetireStage.cpp +++ b/lib/MCA/Stages/RetireStage.cpp @@ -14,8 +14,8 @@ /// //===----------------------------------------------------------------------===// -#include "Stages/RetireStage.h" -#include "HWEventListener.h" +#include "llvm/MCA/Stages/RetireStage.h" +#include "llvm/MCA/HWEventListener.h" #include "llvm/Support/Debug.h" #define DEBUG_TYPE "llvm-mca" diff --git a/tools/llvm-mca/lib/Stages/Stage.cpp b/lib/MCA/Stages/Stage.cpp similarity index 95% rename from tools/llvm-mca/lib/Stages/Stage.cpp rename to lib/MCA/Stages/Stage.cpp index c3cfe47d24e..38191645e73 100644 --- a/tools/llvm-mca/lib/Stages/Stage.cpp +++ b/lib/MCA/Stages/Stage.cpp @@ -13,7 +13,7 @@ /// //===----------------------------------------------------------------------===// -#include "Stages/Stage.h" +#include "llvm/MCA/Stages/Stage.h" namespace llvm { namespace mca { diff --git a/tools/llvm-mca/lib/Support.cpp b/lib/MCA/Support.cpp similarity index 98% rename from tools/llvm-mca/lib/Support.cpp rename to lib/MCA/Support.cpp index a6ff26dafb5..3271bc6bf5b 100644 --- a/tools/llvm-mca/lib/Support.cpp +++ b/lib/MCA/Support.cpp @@ -13,7 +13,7 @@ /// //===----------------------------------------------------------------------===// -#include "Support.h" +#include "llvm/MCA/Support.h" #include "llvm/MC/MCSchedule.h" namespace llvm { diff --git a/tools/llvm-mca/CMakeLists.txt b/tools/llvm-mca/CMakeLists.txt index 4339d48d461..1fceb08c1ca 100644 --- a/tools/llvm-mca/CMakeLists.txt +++ b/tools/llvm-mca/CMakeLists.txt @@ -6,6 +6,7 @@ set(LLVM_LINK_COMPONENTS AllTargetsDescs AllTargetsDisassemblers AllTargetsInfos + MCA MC MCParser Support @@ -28,5 +29,3 @@ add_llvm_tool(llvm-mca ) set(LLVM_MCA_SOURCE_DIR ${CURRENT_SOURCE_DIR}) -add_subdirectory(lib) -target_link_libraries(llvm-mca PRIVATE LLVMMCA) diff --git a/tools/llvm-mca/LLVMBuild.txt b/tools/llvm-mca/LLVMBuild.txt index 0afcd3129ec..a704612934f 100644 --- a/tools/llvm-mca/LLVMBuild.txt +++ b/tools/llvm-mca/LLVMBuild.txt @@ -19,4 +19,4 @@ type = Tool name = llvm-mca parent = Tools -required_libraries = MC MCParser Support all-targets +required_libraries = MC MCA MCParser Support all-targets diff --git a/tools/llvm-mca/PipelinePrinter.h b/tools/llvm-mca/PipelinePrinter.h index 7e426383f21..456026e12df 100644 --- a/tools/llvm-mca/PipelinePrinter.h +++ b/tools/llvm-mca/PipelinePrinter.h @@ -17,9 +17,9 @@ #ifndef LLVM_TOOLS_LLVM_MCA_PIPELINEPRINTER_H #define LLVM_TOOLS_LLVM_MCA_PIPELINEPRINTER_H -#include "Pipeline.h" #include "Views/View.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/MCA/Pipeline.h" #include "llvm/Support/raw_ostream.h" #define DEBUG_TYPE "llvm-mca" diff --git a/tools/llvm-mca/Views/SummaryView.cpp b/tools/llvm-mca/Views/SummaryView.cpp index fdf27600c93..3a7eb827c47 100644 --- a/tools/llvm-mca/Views/SummaryView.cpp +++ b/tools/llvm-mca/Views/SummaryView.cpp @@ -14,8 +14,8 @@ //===----------------------------------------------------------------------===// #include "Views/SummaryView.h" -#include "Support.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/MCA/Support.h" #include "llvm/Support/Format.h" namespace llvm { diff --git a/tools/llvm-mca/Views/View.h b/tools/llvm-mca/Views/View.h index c332bb53938..4b82b0da0d2 100644 --- a/tools/llvm-mca/Views/View.h +++ b/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 "llvm/MCA/HWEventListener.h" #include "llvm/Support/raw_ostream.h" namespace llvm { diff --git a/tools/llvm-mca/llvm-mca.cpp b/tools/llvm-mca/llvm-mca.cpp index a5edbcebc88..310b0bfad93 100644 --- a/tools/llvm-mca/llvm-mca.cpp +++ b/tools/llvm-mca/llvm-mca.cpp @@ -24,8 +24,6 @@ #include "CodeRegion.h" #include "CodeRegionGenerator.h" #include "PipelinePrinter.h" -#include "Stages/EntryStage.h" -#include "Stages/InstructionTables.h" #include "Views/DispatchStatistics.h" #include "Views/InstructionInfoView.h" #include "Views/RegisterFileStatistics.h" @@ -34,13 +32,15 @@ #include "Views/SchedulerStatistics.h" #include "Views/SummaryView.h" #include "Views/TimelineView.h" -#include "include/Context.h" -#include "include/Pipeline.h" -#include "include/Support.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCObjectFileInfo.h" #include "llvm/MC/MCRegisterInfo.h" +#include "llvm/MCA/Context.h" +#include "llvm/MCA/Pipeline.h" +#include "llvm/MCA/Stages/EntryStage.h" +#include "llvm/MCA/Stages/InstructionTables.h" +#include "llvm/MCA/Support.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorOr.h"