void setPos(MachineBasicBlock::const_iterator Pos) { CurrPos = Pos; }
/// Recede across the previous instruction.
- bool recede(SmallVectorImpl<unsigned> *LiveUses = nullptr,
+ void recede(SmallVectorImpl<unsigned> *LiveUses = nullptr,
PressureDiff *PDiff = nullptr);
/// Advance across the current instruction.
- bool advance();
+ void advance();
/// Finalize the region boundaries and recored live ins and live outs.
void closeRegion();
ArrayRef<unsigned> getLiveThru() const { return LiveThruPressure; }
/// Get the resulting register pressure over the traversed region.
- /// This result is complete if either advance() or recede() has returned true,
- /// or if closeRegion() was explicitly invoked.
+ /// This result is complete if closeRegion() was explicitly invoked.
RegisterPressure &getPressure() { return P; }
const RegisterPressure &getPressure() const { return P; }
/// registers that are both defined and used by the instruction. If a pressure
/// difference pointer is provided record the changes is pressure caused by this
/// instruction independent of liveness.
-bool RegPressureTracker::recede(SmallVectorImpl<unsigned> *LiveUses,
+void RegPressureTracker::recede(SmallVectorImpl<unsigned> *LiveUses,
PressureDiff *PDiff) {
- // Check for the top of the analyzable region.
- if (CurrPos == MBB->begin()) {
- closeRegion();
- return false;
- }
+ assert(CurrPos != MBB->begin());
if (!isBottomClosed())
closeBottom();
do
--CurrPos;
while (CurrPos != MBB->begin() && CurrPos->isDebugValue());
+ assert(!CurrPos->isDebugValue());
- if (CurrPos->isDebugValue()) {
- closeRegion();
- return false;
- }
SlotIndex SlotIdx;
if (RequireIntervals)
SlotIdx = LIS->getInstructionIndex(CurrPos).getRegSlot();
UntiedDefs.insert(Reg);
}
}
- return true;
}
/// Advance across the current instruction.
-bool RegPressureTracker::advance() {
+void RegPressureTracker::advance() {
assert(!TrackUntiedDefs && "unsupported mode");
- // Check for the bottom of the analyzable region.
- if (CurrPos == MBB->end()) {
- closeRegion();
- return false;
- }
+ assert(CurrPos != MBB->end());
if (!isTopClosed())
closeTop();
do
++CurrPos;
while (CurrPos != MBB->end() && CurrPos->isDebugValue());
- return true;
}
/// Find the max change in excess pressure across all sets.