diff options
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp | 8 | ||||
-rw-r--r-- | llvm/tools/llvm-mca/llvm-mca.cpp | 26 |
2 files changed, 20 insertions, 14 deletions
diff --git a/llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp b/llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp index 7a341d4..06caeda 100644 --- a/llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp +++ b/llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp @@ -48,23 +48,23 @@ void SchedulerStatistics::onEvent(const HWInstructionEvent &Event) { } else if (Event.Type == HWInstructionEvent::Dispatched) { const Instruction &Inst = *Event.IR.getInstruction(); const unsigned Index = Event.IR.getSourceIndex(); - if (LQResourceID && Inst.getDesc().MayLoad && + if (LQResourceID && Inst.getMayLoad() && MostRecentLoadDispatched != Index) { Usage[LQResourceID].SlotsInUse++; MostRecentLoadDispatched = Index; } - if (SQResourceID && Inst.getDesc().MayStore && + if (SQResourceID && Inst.getMayStore() && MostRecentStoreDispatched != Index) { Usage[SQResourceID].SlotsInUse++; MostRecentStoreDispatched = Index; } } else if (Event.Type == HWInstructionEvent::Executed) { const Instruction &Inst = *Event.IR.getInstruction(); - if (LQResourceID && Inst.getDesc().MayLoad) { + if (LQResourceID && Inst.getMayLoad()) { assert(Usage[LQResourceID].SlotsInUse); Usage[LQResourceID].SlotsInUse--; } - if (SQResourceID && Inst.getDesc().MayStore) { + if (SQResourceID && Inst.getMayStore()) { assert(Usage[SQResourceID].SlotsInUse); Usage[SQResourceID].SlotsInUse--; } 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) { |