LLVM API Documentation

llvm::SimpleRegisterCoalescing Class Reference

#include <SimpleRegisterCoalescing.h>

Inheritance diagram for llvm::SimpleRegisterCoalescing:
[legend]
Collaboration diagram for llvm::SimpleRegisterCoalescing:
[legend]

List of all members.

Public Member Functions

 SimpleRegisterCoalescing ()
virtual void getAnalysisUsage (AnalysisUsage &AU) const
virtual void releaseMemory ()
virtual bool runOnMachineFunction (MachineFunction &)
 runOnMachineFunction - pass entry point
bool coalesceFunction (MachineFunction &mf, RegallocQuery &)
unsigned getRepIntervalSize (unsigned Reg)
virtual void print (std::ostream &O, const Module *=0) const
 print - Implement the dump method.
void print (std::ostream *O, const Module *M=0) const

Static Public Attributes

static char ID = 0

Classes

struct  InstrSlots


Detailed Description

Definition at line 76 of file SimpleRegisterCoalescing.h.


Constructor & Destructor Documentation

llvm::SimpleRegisterCoalescing::SimpleRegisterCoalescing (  )  [inline]

Definition at line 107 of file SimpleRegisterCoalescing.h.


Member Function Documentation

void SimpleRegisterCoalescing::getAnalysisUsage ( AnalysisUsage &  AU  )  const [virtual]

getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.

For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.

Reimplemented from llvm::MachineFunctionPass.

Definition at line 78 of file SimpleRegisterCoalescing.cpp.

References llvm::AnalysisUsage::addPreserved(), llvm::AnalysisUsage::addPreservedID(), llvm::AnalysisUsage::addRequired(), llvm::MachineFunctionPass::getAnalysisUsage(), llvm::MachineDominatorsID, llvm::PHIEliminationID, llvm::AnalysisUsage::setPreservesCFG(), llvm::StrongPHIElim, llvm::StrongPHIEliminationID, and llvm::TwoAddressInstructionPassID.

void SimpleRegisterCoalescing::releaseMemory (  )  [virtual]

releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused.

Optionally implement this function to release pass memory when it is no longer used.

Reimplemented from llvm::Pass.

Definition at line 2587 of file SimpleRegisterCoalescing.cpp.

bool SimpleRegisterCoalescing::runOnMachineFunction ( MachineFunction &  fn  )  [virtual]

runOnMachineFunction - pass entry point

Implements llvm::MachineFunctionPass.

Definition at line 2602 of file SimpleRegisterCoalescing.cpp.

References llvm::SmallVectorImpl< T >::back(), llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), llvm::LiveIntervals::begin(), llvm::SmallVectorImpl< T >::clear(), llvm::SmallSet< T, N >::count(), DEBUG, DOUT, E, llvm::SmallVectorImpl< T >::empty(), EnableJoining, llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), llvm::LiveIntervals::end(), llvm::errs(), llvm::TargetInstrInfo::EXTRACT_SUBREG, llvm::TargetRegisterInfo::getAllocatableSet(), llvm::LiveIntervals::getApproximateInstructionCount(), llvm::MachineFunction::getFunction(), llvm::TargetMachine::getInstrInfo(), llvm::LiveIntervals::getInterval(), llvm::Intrinsic::getName(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegAllocationHint(), llvm::MachineFunction::getRegInfo(), llvm::TargetMachine::getRegisterInfo(), llvm::LiveIntervals::getSpillWeight(), llvm::MachineFunction::getTarget(), llvm::LiveIntervals::hasInterval(), HUGE_VALF, if(), llvm::SmallSet< T, N >::insert(), llvm::TargetInstrInfo::INSERT_SUBREG, llvm::MachineOperand::isDead(), llvm::MachineOperand::isDef(), llvm::TargetInstrInfo::isMoveInstr(), llvm::TargetRegisterInfo::isPhysicalRegister(), llvm::MachineOperand::isReg(), llvm::LiveIntervals::isReMaterializable(), llvm::MachineOperand::isUse(), llvm::TargetRegisterInfo::isVirtualRegister(), isZeroLengthInterval(), llvm::SimpleRegisterCoalescing::InstrSlots::NUM, llvm::SmallVectorImpl< T >::pop_back(), llvm::SmallVectorImpl< T >::push_back(), llvm::LiveInterval::reg, llvm::TargetRegisterInfo::regclass_begin(), llvm::TargetRegisterInfo::regclass_end(), llvm::MachineInstr::registerDefIsDead(), llvm::LiveIntervals::RemoveMachineInstrFromMaps(), llvm::TargetInstrInfo::SUBREG_TO_REG, llvm::MachineRegisterInfo::use_empty(), and llvm::LiveInterval::weight.

bool llvm::SimpleRegisterCoalescing::coalesceFunction ( MachineFunction &  mf,
RegallocQuery &  ifd 
) [inline, virtual]

Run the coalescer on this function, providing interference data to query. Return whether we removed any copies.

Implements llvm::RegisterCoalescer.

Definition at line 125 of file SimpleRegisterCoalescing.h.

unsigned llvm::SimpleRegisterCoalescing::getRepIntervalSize ( unsigned  Reg  )  [inline]

getRepIntervalSize - Called from join priority queue sorting function. It returns the size of the interval that represent the given register.

Definition at line 132 of file SimpleRegisterCoalescing.h.

References llvm::LiveIntervals::getApproximateInstructionCount(), llvm::LiveIntervals::getInterval(), llvm::LiveIntervals::hasInterval(), and llvm::LiveInterval::InstrSlots::NUM.

Referenced by llvm::JoinPriorityQueue< SF >::getRepIntervalSize().

void SimpleRegisterCoalescing::print ( std::ostream &  O,
const Module *  m = 0 
) const [virtual]

print - Implement the dump method.

Reimplemented from llvm::Pass.

Definition at line 2776 of file SimpleRegisterCoalescing.cpp.

References llvm::LiveIntervals::print().

Referenced by print().

void llvm::SimpleRegisterCoalescing::print ( std::ostream *  O,
const Module *  M = 0 
) const [inline]

Reimplemented from llvm::Pass.

Definition at line 141 of file SimpleRegisterCoalescing.h.

References M, and print().


Member Data Documentation

char SimpleRegisterCoalescing::ID = 0 [static]

Reimplemented from llvm::RegisterCoalescer.

Definition at line 106 of file SimpleRegisterCoalescing.h.


The documentation for this class was generated from the following files: