aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-mca/llvm-mca.cpp
diff options
context:
space:
mode:
authorAndrea Di Biagio <andrea.dibiagio@sony.com>2021-06-15 21:34:41 +0100
committerAndrea Di Biagio <andrea.dibiagio@sony.com>2021-06-15 21:41:36 +0100
commita04f01bab2da4650cc90a351fd734e626e6797af (patch)
treed536041f6518272d389d5e3f2905f4ebbc0be550 /llvm/tools/llvm-mca/llvm-mca.cpp
parentf7a23ecece524564a0c3e09787142cc6061027bb (diff)
downloadllvm-a04f01bab2da4650cc90a351fd734e626e6797af.zip
llvm-a04f01bab2da4650cc90a351fd734e626e6797af.tar.gz
llvm-a04f01bab2da4650cc90a351fd734e626e6797af.tar.bz2
Revert "[MCA] Adding the CustomBehaviour class to llvm-mca"
This reverts commit f7a23ecece524564a0c3e09787142cc6061027bb. It appears to breaks buildbots that don't build the AMDGPU backend.
Diffstat (limited to 'llvm/tools/llvm-mca/llvm-mca.cpp')
-rw-r--r--llvm/tools/llvm-mca/llvm-mca.cpp56
1 files changed, 1 insertions, 55 deletions
diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp
index df19c74..3bb2f10 100644
--- a/llvm/tools/llvm-mca/llvm-mca.cpp
+++ b/llvm/tools/llvm-mca/llvm-mca.cpp
@@ -32,7 +32,6 @@
#include "Views/SchedulerStatistics.h"
#include "Views/SummaryView.h"
#include "Views/TimelineView.h"
-#include "lib/AMDGPU/AMDGPUCustomBehaviour.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCCodeEmitter.h"
@@ -43,7 +42,6 @@
#include "llvm/MC/MCTargetOptionsCommandFlags.h"
#include "llvm/MCA/CodeEmitter.h"
#include "llvm/MCA/Context.h"
-#include "llvm/MCA/CustomBehaviour.h"
#include "llvm/MCA/InstrBuilder.h"
#include "llvm/MCA/Pipeline.h"
#include "llvm/MCA/Stages/EntryStage.h"
@@ -222,12 +220,6 @@ static cl::opt<bool> ShowEncoding(
cl::desc("Print encoding information in the instruction info view"),
cl::cat(ViewOptions), cl::init(false));
-static cl::opt<bool> DisableCustomBehaviour(
- "disable-cb",
- cl::desc(
- "Disable custom behaviour (use the default class which does nothing)."),
- cl::cat(ViewOptions), cl::init(false));
-
namespace {
const Target *getTarget(const char *ProgName) {
@@ -293,39 +285,6 @@ static void processViewOptions(bool IsOutOfOrder) {
processOptionImpl(PrintRetireStats, Default);
}
-std::unique_ptr<mca::InstrPostProcess>
-createInstrPostProcess(const Triple &TheTriple, const MCSubtargetInfo &STI,
- const MCInstrInfo &MCII) {
- // Might be a good idea to have a separate flag so that InstrPostProcess
- // can be used with or without CustomBehaviour
- if (DisableCustomBehaviour)
- return std::make_unique<mca::InstrPostProcess>(STI, MCII);
-
- if (TheTriple.isAMDGPU())
- return std::make_unique<mca::AMDGPUInstrPostProcess>(STI, MCII);
-
- return std::make_unique<mca::InstrPostProcess>(STI, MCII);
-}
-
-std::unique_ptr<mca::CustomBehaviour>
-createCustomBehaviour(const Triple &TheTriple, const MCSubtargetInfo &STI,
- const mca::SourceMgr &SrcMgr, const MCInstrInfo &MCII) {
- // Build the appropriate CustomBehaviour object for the current target.
- // The CustomBehaviour class should never depend on the source code,
- // but it can depend on the list of mca::Instruction and any classes
- // that can be built using just the target info. If you need extra
- // information from the source code or the list of MCInst, consider
- // adding that information to the mca::Instruction class and setting
- // it during InstrBuilder::createInstruction().
- if (DisableCustomBehaviour)
- return std::make_unique<mca::CustomBehaviour>(STI, SrcMgr, MCII);
-
- if (TheTriple.isAMDGPU())
- return std::make_unique<mca::AMDGPUCustomBehaviour>(STI, SrcMgr, MCII);
-
- return std::make_unique<mca::CustomBehaviour>(STI, SrcMgr, MCII);
-}
-
// Returns true on success.
static bool runPipeline(mca::Pipeline &P) {
// Handle pipeline errors here.
@@ -539,8 +498,6 @@ int main(int argc, char **argv) {
// Lower the MCInst sequence into an mca::Instruction sequence.
ArrayRef<MCInst> Insts = Region->getInstructions();
mca::CodeEmitter CE(*STI, *MAB, *MCE, Insts);
- std::unique_ptr<mca::InstrPostProcess> IPP =
- createInstrPostProcess(TheTriple, *STI, *MCII);
std::vector<std::unique_ptr<mca::Instruction>> LoweredSequence;
for (const MCInst &MCI : Insts) {
Expected<std::unique_ptr<mca::Instruction>> Inst =
@@ -563,8 +520,6 @@ int main(int argc, char **argv) {
return 1;
}
- IPP->postProcessInstruction(Inst.get(), MCI);
-
LoweredSequence.emplace_back(std::move(Inst.get()));
}
@@ -592,17 +547,8 @@ int main(int argc, char **argv) {
continue;
}
- // Create the CustomBehaviour object for enforcing Target Specific
- // behaviours and dependencies that aren't expressed well enough
- // in the tablegen. CB cannot depend on the list of MCInst or
- // the source code (but it can depend on the list of
- // mca::Instruction or any objects that can be reconstructed
- // from the target information).
- std::unique_ptr<mca::CustomBehaviour> CB =
- createCustomBehaviour(TheTriple, *STI, S, *MCII);
-
// Create a basic pipeline simulating an out-of-order backend.
- auto P = MCA.createDefaultPipeline(PO, S, *CB);
+ auto P = MCA.createDefaultPipeline(PO, S);
mca::PipelinePrinter Printer(*P, PrintJson ? mca::View::OK_JSON
: mca::View::OK_READABLE);