LLVM API Documentation
#include "llvm/CodeGen/RegisterPressure.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RegisterClassInfo.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
Go to the source code of this file.
Classes | |
class | RegisterOperands |
Functions | |
static void | increaseSetPressure (std::vector< unsigned > &CurrSetPressure, PSetIterator PSetI) |
Increase pressure for each pressure set provided by TargetRegisterInfo. | |
static void | decreaseSetPressure (std::vector< unsigned > &CurrSetPressure, PSetIterator PSetI) |
Decrease pressure for each pressure set provided by TargetRegisterInfo. | |
static bool | containsReg (ArrayRef< unsigned > RegUnits, unsigned RegUnit) |
Convenient wrapper for checking membership in RegisterOperands. (std::count() doesn't have an early exit). | |
static void | collectOperands (const MachineInstr *MI, RegisterOperands &RegOpers) |
Collect physical and virtual register operands. | |
static void | collectPDiff (PressureDiff &PDiff, RegisterOperands &RegOpers, const MachineRegisterInfo *MRI) |
Record the pressure difference induced by the given operand list. | |
static void | computeExcessPressureDelta (ArrayRef< unsigned > OldPressureVec, ArrayRef< unsigned > NewPressureVec, RegPressureDelta &Delta, const RegisterClassInfo *RCI, ArrayRef< unsigned > LiveThruPressureVec) |
Find the max change in excess pressure across all sets. | |
static void | computeMaxPressureDelta (ArrayRef< unsigned > OldMaxPressureVec, ArrayRef< unsigned > NewMaxPressureVec, ArrayRef< PressureChange > CriticalPSets, ArrayRef< unsigned > MaxPressureLimit, RegPressureDelta &Delta) |
static bool | findUseBetween (unsigned Reg, SlotIndex PriorUseIdx, SlotIndex NextUseIdx, const MachineRegisterInfo *MRI, const LiveIntervals *LIS) |
Helper to find a vreg use between two indices [PriorUseIdx, NextUseIdx). |
static void collectOperands | ( | const MachineInstr * | MI, |
RegisterOperands & | RegOpers | ||
) | [static] |
Collect physical and virtual register operands.
Definition at line 360 of file RegisterPressure.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), RegisterOperands::collect(), containsReg(), RegisterOperands::DeadDefs, RegisterOperands::Defs, llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::SmallVectorImpl< T >::erase(), I, and llvm::MachineOperandIteratorBase::isValid().
Referenced by llvm::RegPressureTracker::advance(), llvm::RegPressureTracker::bumpDownwardPressure(), llvm::RegPressureTracker::bumpUpwardPressure(), and llvm::RegPressureTracker::recede().
static void collectPDiff | ( | PressureDiff & | PDiff, |
RegisterOperands & | RegOpers, | ||
const MachineRegisterInfo * | MRI | ||
) | [static] |
Record the pressure difference induced by the given operand list.
Definition at line 411 of file RegisterPressure.cpp.
References llvm::PressureDiff::addPressureChange(), llvm::PressureDiff::begin(), RegisterOperands::Defs, llvm::PressureChange::isValid(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and RegisterOperands::Uses.
Referenced by llvm::RegPressureTracker::recede().
static void computeExcessPressureDelta | ( | ArrayRef< unsigned > | OldPressureVec, |
ArrayRef< unsigned > | NewPressureVec, | ||
RegPressureDelta & | Delta, | ||
const RegisterClassInfo * | RCI, | ||
ArrayRef< unsigned > | LiveThruPressureVec | ||
) | [static] |
Find the max change in excess pressure across all sets.
Definition at line 623 of file RegisterPressure.cpp.
References llvm::ArrayRef< T >::empty(), llvm::RegPressureDelta::Excess, llvm::RegisterClassInfo::getRegPressureSetLimit(), llvm::PressureChange::setUnitInc(), and llvm::ArrayRef< T >::size().
Referenced by llvm::RegPressureTracker::getMaxDownwardPressureDelta(), and llvm::RegPressureTracker::getMaxUpwardPressureDelta().
static void computeMaxPressureDelta | ( | ArrayRef< unsigned > | OldMaxPressureVec, |
ArrayRef< unsigned > | NewMaxPressureVec, | ||
ArrayRef< PressureChange > | CriticalPSets, | ||
ArrayRef< unsigned > | MaxPressureLimit, | ||
RegPressureDelta & | Delta | ||
) | [static] |
Find the max change in max pressure that either surpasses a critical PSet limit or exceeds the current MaxPressureLimit.
FIXME: comparing each element of the old and new MaxPressure vectors here is silly. It's done now to demonstrate the concept but will go away with a RegPressureTracker API change to work with pressure differences.
Definition at line 663 of file RegisterPressure.cpp.
References llvm::RegPressureDelta::CriticalMax, llvm::RegPressureDelta::CurrentMax, llvm::PressureChange::isValid(), llvm::PressureChange::setUnitInc(), and llvm::ArrayRef< T >::size().
Referenced by llvm::RegPressureTracker::getMaxDownwardPressureDelta(), and llvm::RegPressureTracker::getMaxUpwardPressureDelta().
static bool containsReg | ( | ArrayRef< unsigned > | RegUnits, |
unsigned | RegUnit | ||
) | [static] |
Convenient wrapper for checking membership in RegisterOperands. (std::count() doesn't have an early exit).
Definition at line 304 of file RegisterPressure.cpp.
References llvm::ArrayRef< T >::begin(), and llvm::ArrayRef< T >::end().
Referenced by llvm::RegPressureTracker::bumpUpwardPressure(), collectOperands(), llvm::RegPressureTracker::discoverLiveIn(), llvm::RegPressureTracker::discoverLiveOut(), RegisterOperands::pushRegUnits(), and llvm::RegPressureTracker::recede().
static void decreaseSetPressure | ( | std::vector< unsigned > & | CurrSetPressure, |
PSetIterator | PSetI | ||
) | [static] |
Decrease pressure for each pressure set provided by TargetRegisterInfo.
Definition at line 35 of file RegisterPressure.cpp.
References llvm::PSetIterator::getWeight(), and llvm::PSetIterator::isValid().
Referenced by llvm::RegPressureTracker::decreaseRegPressure().
static bool findUseBetween | ( | unsigned | Reg, |
SlotIndex | PriorUseIdx, | ||
SlotIndex | NextUseIdx, | ||
const MachineRegisterInfo * | MRI, | ||
const LiveIntervals * | LIS | ||
) | [static] |
Helper to find a vreg use between two indices [PriorUseIdx, NextUseIdx).
Definition at line 882 of file RegisterPressure.cpp.
References llvm::LiveIntervals::getInstructionIndex(), llvm::SlotIndex::getRegSlot(), llvm::MachineInstr::isDebugValue(), llvm::AArch64CC::MI, llvm::MachineRegisterInfo::use_instr_nodbg_begin(), and llvm::MachineRegisterInfo::use_instr_nodbg_end().
Referenced by llvm::RegPressureTracker::bumpDownwardPressure().
static void increaseSetPressure | ( | std::vector< unsigned > & | CurrSetPressure, |
PSetIterator | PSetI | ||
) | [static] |
Increase pressure for each pressure set provided by TargetRegisterInfo.
Definition at line 27 of file RegisterPressure.cpp.
References llvm::PSetIterator::getWeight(), and llvm::PSetIterator::isValid().
Referenced by llvm::RegPressureTracker::discoverLiveIn(), llvm::RegPressureTracker::discoverLiveOut(), and llvm::RegPressureTracker::initLiveThru().