diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-07-03 14:10:23 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-07-03 14:10:23 +0000 |
commit | 145449b1e420787bb99721a429341fa6be3adfb6 (patch) | |
tree | 1d56ae694a6de602e348dd80165cf881a36600ed /llvm/lib/CodeGen/MachineScheduler.cpp | |
parent | ecbca9f5fb7d7613d2b94982c4825eb0d33d6842 (diff) |
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineScheduler.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp index b043d4c1b0c1..4e00a211713e 100644 --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/lib/CodeGen/MachineScheduler.cpp @@ -32,7 +32,6 @@ #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachinePassRegistry.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/RegisterClassInfo.h" #include "llvm/CodeGen/RegisterPressure.h" #include "llvm/CodeGen/ScheduleDAG.h" @@ -752,7 +751,7 @@ void ScheduleDAGMI::moveInstruction( } bool ScheduleDAGMI::checkSchedLimit() { -#ifndef NDEBUG +#if LLVM_ENABLE_ABI_BREAKING_CHECKS if (NumInstrsScheduled == MISchedCutoff && MISchedCutoff != ~0U) { CurrentTop = CurrentBottom; return false; @@ -920,12 +919,10 @@ void ScheduleDAGMI::placeDebugValues() { MachineBasicBlock::iterator OrigPrevMI = P.second; if (&*RegionBegin == DbgValue) ++RegionBegin; - BB->splice(++OrigPrevMI, BB, DbgValue); - if (OrigPrevMI == std::prev(RegionEnd)) + BB->splice(std::next(OrigPrevMI), BB, DbgValue); + if (RegionEnd != BB->end() && OrigPrevMI == &*RegionEnd) RegionEnd = DbgValue; } - DbgValues.clear(); - FirstDbgValue = nullptr; } #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) @@ -2008,7 +2005,7 @@ void SchedBoundary::reset() { ReservedCycles.clear(); ReservedCyclesIndex.clear(); ResourceGroupSubUnitMasks.clear(); -#ifndef NDEBUG +#if LLVM_ENABLE_ABI_BREAKING_CHECKS // Track the maximum number of stall cycles that could arise either from the // latency of a DAG edge or the number of cycles that a processor resource is // reserved (SchedBoundary::ReservedCycles). @@ -2196,7 +2193,7 @@ bool SchedBoundary::checkHazard(SUnit *SU) { unsigned NRCycle, InstanceIdx; std::tie(NRCycle, InstanceIdx) = getNextResourceCycle(SC, ResIdx, Cycles); if (NRCycle > CurrCycle) { -#ifndef NDEBUG +#if LLVM_ENABLE_ABI_BREAKING_CHECKS MaxObservedStall = std::max(Cycles, MaxObservedStall); #endif LLVM_DEBUG(dbgs() << " SU(" << SU->NodeNum << ") " @@ -2263,7 +2260,7 @@ void SchedBoundary::releaseNode(SUnit *SU, unsigned ReadyCycle, bool InPQueue, unsigned Idx) { assert(SU->getInstr() && "Scheduled SUnit must have instr"); -#ifndef NDEBUG +#if LLVM_ENABLE_ABI_BREAKING_CHECKS // ReadyCycle was been bumped up to the CurrCycle when this node was // scheduled, but CurrCycle may have been eagerly advanced immediately after // scheduling, so may now be greater than ReadyCycle. |