Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
remove names from comments, fix typos; NFC
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238027 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rotateright committed May 22, 2015
1 parent 3e785f0 commit 08bac7b
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions include/llvm/CodeGen/RegisterScavenging.h
Expand Up @@ -36,8 +36,7 @@ class RegScavenger {
MachineBasicBlock::iterator MBBI;
unsigned NumRegUnits;

/// Tracking - True if RegScavenger is currently tracking the liveness of
/// registers.
/// True if RegScavenger is currently tracking the liveness of registers.
bool Tracking;

/// Information on scavenged registers (held in a spill slot).
Expand All @@ -58,8 +57,8 @@ class RegScavenger {
/// A vector of information on scavenged registers.
SmallVector<ScavengedInfo, 2> Scavenged;

/// RegUnitsAvailable - The current state of each reg unit immediatelly
/// before MBBI. One bit per register unit. If bit is not set it means any
/// The current state of each reg unit immediately before MBBI.
/// One bit per register unit. If bit is not set it means any
/// register containing that register unit is currently being used.
BitVector RegUnitsAvailable;

Expand All @@ -72,18 +71,17 @@ class RegScavenger {
RegScavenger()
: MBB(nullptr), NumRegUnits(0), Tracking(false) {}

/// enterBasicBlock - Start tracking liveness from the begin of the specific
/// basic block.
/// Start tracking liveness from the begin of the specific basic block.
void enterBasicBlock(MachineBasicBlock *mbb);

/// initRegState - allow resetting register state info for multiple
/// Allow resetting register state info for multiple
/// passes over/within the same function.
void initRegState();

/// forward - Move the internal MBB iterator and update register states.
/// Move the internal MBB iterator and update register states.
void forward();

/// forward - Move the internal MBB iterator and update register states until
/// Move the internal MBB iterator and update register states until
/// it has processed the specific iterator.
void forward(MachineBasicBlock::iterator I) {
if (!Tracking && MBB->begin() != I) forward();
Expand All @@ -99,7 +97,7 @@ class RegScavenger {
while (MBBI != I) unprocess();
}

/// skipTo - Move the internal MBB iterator but do not update register states.
/// Move the internal MBB iterator but do not update register states.
void skipTo(MachineBasicBlock::iterator I) {
if (I == MachineBasicBlock::iterator(nullptr))
Tracking = false;
Expand All @@ -110,14 +108,13 @@ class RegScavenger {
return MBBI;
}

/// isRegUsed - return if a specific register is currently used.
/// Return if a specific register is currently used.
bool isRegUsed(unsigned Reg, bool includeReserved = true) const;

/// getRegsAvailable - Return all available registers in the register class
/// in Mask.
/// Return all available registers in the register class in Mask.
BitVector getRegsAvailable(const TargetRegisterClass *RC);

/// FindUnusedReg - Find a unused register of the specified register class.
/// Find an unused register of the specified register class.
/// Return 0 if none is found.
unsigned FindUnusedReg(const TargetRegisterClass *RegClass) const;

Expand All @@ -144,7 +141,7 @@ class RegScavenger {
A.push_back(I->FrameIndex);
}

/// scavengeRegister - Make a register of the specific register class
/// Make a register of the specific register class
/// available and do the appropriate bookkeeping. SPAdj is the stack
/// adjustment due to call frame, it's passed along to eliminateFrameIndex().
/// Returns the scavenged register.
Expand All @@ -154,11 +151,10 @@ class RegScavenger {
return scavengeRegister(RegClass, MBBI, SPAdj);
}

/// setRegUsed - Tell the scavenger a register is used.
///
/// Tell the scavenger a register is used.
void setRegUsed(unsigned Reg);
private:
/// isReserved - Returns true if a register is reserved. It is never "unused".
/// Returns true if a register is reserved. It is never "unused".
bool isReserved(unsigned Reg) const { return MRI->isReserved(Reg); }

/// setUsed / setUnused - Mark the state of one or a number of register units.
Expand All @@ -177,9 +173,8 @@ class RegScavenger {
/// Add all Reg Units that Reg contains to BV.
void addRegUnits(BitVector &BV, unsigned Reg);

/// findSurvivorReg - Return the candidate register that is unused for the
/// longest after StartMI. UseMI is set to the instruction where the search
/// stopped.
/// Return the candidate register that is unused for the longest after
/// StartMI. UseMI is set to the instruction where the search stopped.
///
/// No more than InstrLimit instructions are inspected.
unsigned findSurvivorReg(MachineBasicBlock::iterator StartMI,
Expand Down

0 comments on commit 08bac7b

Please sign in to comment.