LLVM  10.0.0svn
Public Member Functions | List of all members
llvm::NamedVRegCursor Class Reference

NamedVRegCursor - The cursor is an object that keeps track of what the next vreg name should be. More...

#include "CodeGen/MIRVRegNamerUtils.h"

Public Member Functions

 NamedVRegCursor ()=delete
 
 NamedVRegCursor (MachineRegisterInfo &MRI, unsigned SkipGapSize=1000)
 1000 for the SkipGapSize was a good heuristic at the time of the writing of the MIRCanonicalizerPass. More...
 
void skipVRegs ()
 SkipGapSize - Skips modulo a gap value of indices. More...
 
unsigned getVirtualVReg () const
 
unsigned incrementVirtualVReg (unsigned incr=1)
 incrementVirtualVReg - This increments an index value that us used to create a new vreg name. More...
 
unsigned createVirtualRegister (unsigned VReg)
 createVirtualRegister - Given an existing vreg, create a named vreg to take its place. More...
 
bool renameVRegs (MachineBasicBlock *MBB)
 renameVRegs - For a given MachineBasicBlock, scan for side-effecting instructions, walk the def-use from each side-effecting root (in sorted root order) and rename the encountered vregs in the def-use graph in a canonical ordering. More...
 

Detailed Description

NamedVRegCursor - The cursor is an object that keeps track of what the next vreg name should be.

It does book keeping to determine when to skip the index value and by how much, or if the next vreg name should be an increment from the previous.

Definition at line 36 of file MIRVRegNamerUtils.h.

Constructor & Destructor Documentation

◆ NamedVRegCursor() [1/2]

llvm::NamedVRegCursor::NamedVRegCursor ( )
delete

◆ NamedVRegCursor() [2/2]

llvm::NamedVRegCursor::NamedVRegCursor ( MachineRegisterInfo MRI,
unsigned  SkipGapSize = 1000 
)
inline

1000 for the SkipGapSize was a good heuristic at the time of the writing of the MIRCanonicalizerPass.

Adjust as needed.

Definition at line 60 of file MIRVRegNamerUtils.h.

References skipVRegs().

Member Function Documentation

◆ createVirtualRegister()

unsigned NamedVRegCursor::createVirtualRegister ( unsigned  VReg)

createVirtualRegister - Given an existing vreg, create a named vreg to take its place.

Definition at line 333 of file MIRVRegNamerUtils.cpp.

References llvm::raw_ostream::flush(), MRI, and llvm::raw_string_ostream::str().

Referenced by incrementVirtualVReg(), and runOnBasicBlock().

◆ getVirtualVReg()

unsigned llvm::NamedVRegCursor::getVirtualVReg ( ) const
inline

Definition at line 67 of file MIRVRegNamerUtils.h.

◆ incrementVirtualVReg()

unsigned llvm::NamedVRegCursor::incrementVirtualVReg ( unsigned  incr = 1)
inline

incrementVirtualVReg - This increments an index value that us used to create a new vreg name.

This is not a Register.

Definition at line 71 of file MIRVRegNamerUtils.h.

References createVirtualRegister(), and renameVRegs().

◆ renameVRegs()

bool NamedVRegCursor::renameVRegs ( MachineBasicBlock MBB)

renameVRegs - For a given MachineBasicBlock, scan for side-effecting instructions, walk the def-use from each side-effecting root (in sorted root order) and rename the encountered vregs in the def-use graph in a canonical ordering.

This method maintains book keeping for which vregs were already renamed in RenamedInOtherBB.

Definition at line 346 of file MIRVRegNamerUtils.cpp.

Referenced by incrementVirtualVReg(), and runOnBasicBlock().

◆ skipVRegs()

void NamedVRegCursor::skipVRegs ( )

SkipGapSize - Skips modulo a gap value of indices.

Indices are used to produce the next vreg name.

Definition at line 319 of file MIRVRegNamerUtils.cpp.

References E, I, and MRI.

Referenced by NamedVRegCursor(), and runOnBasicBlock().


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