LLVM API Documentation

Classes | Functions
RegisterPressure.cpp File Reference
#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"
Include dependency graph for RegisterPressure.cpp:

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).

Function Documentation

static void collectOperands ( const MachineInstr MI,
RegisterOperands RegOpers 
) [static]
static void collectPDiff ( PressureDiff PDiff,
RegisterOperands RegOpers,
const MachineRegisterInfo MRI 
) [static]
static void computeExcessPressureDelta ( ArrayRef< unsigned OldPressureVec,
ArrayRef< unsigned NewPressureVec,
RegPressureDelta Delta,
const RegisterClassInfo RCI,
ArrayRef< unsigned LiveThruPressureVec 
) [static]
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]
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]
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().