diff options
author | Patrick Holland <patrickeholland@gmail.com> | 2022-03-11 19:52:36 -0800 |
---|---|---|
committer | Patrick Holland <patrickeholland@gmail.com> | 2022-03-13 21:21:05 -0700 |
commit | 55cedf9cc570d74d1089ee4e7b347b4d05d007c5 (patch) | |
tree | 237fb096fab4cf7faee24c6162825569f643a460 /llvm/tools/llvm-mca/llvm-mca.cpp | |
parent | 0c4bbd293e6676cf7c45b95ad0890e0c1e423c3d (diff) | |
download | llvm-55cedf9cc570d74d1089ee4e7b347b4d05d007c5.zip llvm-55cedf9cc570d74d1089ee4e7b347b4d05d007c5.tar.gz llvm-55cedf9cc570d74d1089ee4e7b347b4d05d007c5.tar.bz2 |
[MCA] Moved six instruction flags from InstrDesc to InstructionBase.
Differential Revision: https://reviews.llvm.org/D121508
Diffstat (limited to 'llvm/tools/llvm-mca/llvm-mca.cpp')
-rw-r--r-- | llvm/tools/llvm-mca/llvm-mca.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp index d990612..cfd1148 100644 --- a/llvm/tools/llvm-mca/llvm-mca.cpp +++ b/llvm/tools/llvm-mca/llvm-mca.cpp @@ -465,6 +465,21 @@ int main(int argc, char **argv) { const MCSchedModel &SM = STI->getSchedModel(); + std::unique_ptr<mca::InstrPostProcess> IPP; + if (!DisableCustomBehaviour) { + // TODO: It may be a good idea to separate CB and IPP so that they can + // be used independently of each other. What I mean by this is to add + // an extra command-line arg --disable-ipp so that CB and IPP can be + // toggled without needing to toggle both of them together. + IPP = std::unique_ptr<mca::InstrPostProcess>( + TheTarget->createInstrPostProcess(*STI, *MCII)); + } + if (!IPP) { + // If the target doesn't have its own IPP implemented (or the -disable-cb + // flag is set) then we use the base class (which does nothing). + IPP = std::make_unique<mca::InstrPostProcess>(*STI, *MCII); + } + // Create an instruction builder. mca::InstrBuilder IB(*STI, *MCII, *MRI, MCIA.get()); @@ -498,16 +513,7 @@ int main(int argc, char **argv) { ArrayRef<MCInst> Insts = Region->getInstructions(); mca::CodeEmitter CE(*STI, *MAB, *MCE, Insts); - std::unique_ptr<mca::InstrPostProcess> IPP; - if (!DisableCustomBehaviour) { - IPP = std::unique_ptr<mca::InstrPostProcess>( - TheTarget->createInstrPostProcess(*STI, *MCII)); - } - if (!IPP) - // If the target doesn't have its own IPP implemented (or the - // -disable-cb flag is set) then we use the base class - // (which does nothing). - IPP = std::make_unique<mca::InstrPostProcess>(*STI, *MCII); + IPP->resetState(); SmallVector<std::unique_ptr<mca::Instruction>> LoweredSequence; for (const MCInst &MCI : Insts) { |