LLVM 22.0.0git
|
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc. More...
#include "llvm/CodeGen/MachineRegisterInfo.h"
Classes | |
class | defusechain_instr_iterator |
defusechain_iterator - This class provides iterator support for machine operands in the function that use or define a specific register. More... | |
class | defusechain_iterator |
reg_begin/reg_end - Provide iteration support to walk over all definitions and uses of a register within the MachineFunction that corresponds to this MachineRegisterInfo object. More... | |
class | Delegate |
struct | VRegAttrs |
All attributes(register class or bank and low-level type) a virtual register can have. More... | |
Public Types | |
using | reg_iterator = defusechain_iterator< true, true, false, true, false > |
reg_iterator/reg_begin/reg_end - Walk all defs and uses of the specified register. | |
using | reg_instr_iterator = defusechain_instr_iterator< true, true, false, true > |
reg_instr_iterator/reg_instr_begin/reg_instr_end - Walk all defs and uses of the specified register, stepping by MachineInstr. | |
using | reg_bundle_iterator = defusechain_instr_iterator< true, true, false, false > |
reg_bundle_iterator/reg_bundle_begin/reg_bundle_end - Walk all defs and uses of the specified register, stepping by bundle. | |
using | reg_nodbg_iterator = defusechain_iterator< true, true, true, true, false > |
reg_nodbg_iterator/reg_nodbg_begin/reg_nodbg_end - Walk all defs and uses of the specified register, skipping those marked as Debug. | |
using | reg_instr_nodbg_iterator = defusechain_instr_iterator< true, true, true, true > |
reg_instr_nodbg_iterator/reg_instr_nodbg_begin/reg_instr_nodbg_end - Walk all defs and uses of the specified register, stepping by MachineInstr, skipping those marked as Debug. | |
using | reg_bundle_nodbg_iterator = defusechain_instr_iterator< true, true, true, false > |
reg_bundle_nodbg_iterator/reg_bundle_nodbg_begin/reg_bundle_nodbg_end - Walk all defs and uses of the specified register, stepping by bundle, skipping those marked as Debug. | |
using | def_iterator = defusechain_iterator< false, true, false, true, false > |
def_iterator/def_begin/def_end - Walk all defs of the specified register. | |
using | def_instr_iterator = defusechain_instr_iterator< false, true, false, true > |
def_instr_iterator/def_instr_begin/def_instr_end - Walk all defs of the specified register, stepping by MachineInst. | |
using | def_bundle_iterator = defusechain_instr_iterator< false, true, false, false > |
def_bundle_iterator/def_bundle_begin/def_bundle_end - Walk all defs of the specified register, stepping by bundle. | |
using | use_iterator = defusechain_iterator< true, false, false, true, false > |
use_iterator/use_begin/use_end - Walk all uses of the specified register. | |
using | use_instr_iterator = defusechain_instr_iterator< true, false, false, true > |
use_instr_iterator/use_instr_begin/use_instr_end - Walk all uses of the specified register, stepping by MachineInstr. | |
using | use_bundle_iterator = defusechain_instr_iterator< true, false, false, false > |
use_bundle_iterator/use_bundle_begin/use_bundle_end - Walk all uses of the specified register, stepping by bundle. | |
using | use_nodbg_iterator = defusechain_iterator< true, false, true, true, false > |
use_nodbg_iterator/use_nodbg_begin/use_nodbg_end - Walk all uses of the specified register, skipping those marked as Debug. | |
using | use_instr_nodbg_iterator = defusechain_instr_iterator< true, false, true, true > |
use_instr_nodbg_iterator/use_instr_nodbg_begin/use_instr_nodbg_end - Walk all uses of the specified register, stepping by MachineInstr, skipping those marked as Debug. | |
using | use_bundle_nodbg_iterator = defusechain_instr_iterator< true, false, true, false > |
use_bundle_nodbg_iterator/use_bundle_nodbg_begin/use_bundle_nodbg_end - Walk all uses of the specified register, stepping by bundle, skipping those marked as Debug. | |
using | livein_iterator = std::vector< std::pair< MCRegister, Register > >::const_iterator |
Public Member Functions | |
LLVM_ABI | MachineRegisterInfo (MachineFunction *MF) |
MachineRegisterInfo (const MachineRegisterInfo &)=delete | |
MachineRegisterInfo & | operator= (const MachineRegisterInfo &)=delete |
const TargetRegisterInfo * | getTargetRegisterInfo () const |
void | resetDelegate (Delegate *delegate) |
void | addDelegate (Delegate *delegate) |
void | noteNewVirtualRegister (Register Reg) |
void | noteCloneVirtualRegister (Register NewReg, Register SrcReg) |
const MachineFunction & | getMF () const |
bool | isSSA () const |
void | leaveSSA () |
bool | tracksLiveness () const |
tracksLiveness - Returns true when tracking register liveness accurately. | |
void | invalidateLiveness () |
invalidateLiveness - Indicates that register liveness is no longer being tracked accurately. | |
bool | shouldTrackSubRegLiveness (const TargetRegisterClass &RC) const |
Returns true if liveness for register class RC should be tracked at the subregister level. | |
bool | shouldTrackSubRegLiveness (Register VReg) const |
bool | subRegLivenessEnabled () const |
bool | isUpdatedCSRsInitialized () const |
Returns true if the updated CSR list was initialized and false otherwise. | |
LLVM_ABI void | disableCalleeSavedRegister (MCRegister Reg) |
Disables the register from the list of CSRs. | |
LLVM_ABI const MCPhysReg * | getCalleeSavedRegs () const |
Returns list of callee saved registers. | |
LLVM_ABI void | setCalleeSavedRegs (ArrayRef< MCPhysReg > CSRs) |
Sets the updated Callee Saved Registers list. | |
LLVM_ABI void | addRegOperandToUseList (MachineOperand *MO) |
Add MO to the linked list of operands for its register. | |
LLVM_ABI void | removeRegOperandFromUseList (MachineOperand *MO) |
Remove MO from its use-def list. | |
LLVM_ABI void | moveOperands (MachineOperand *Dst, MachineOperand *Src, unsigned NumOps) |
Move NumOps operands from Src to Dst, updating use-def lists as needed. | |
LLVM_ABI void | verifyUseList (Register Reg) const |
Verify the sanity of the use list for Reg. | |
LLVM_ABI void | verifyUseLists () const |
Verify the use list of all registers. | |
reg_iterator | reg_begin (Register RegNo) const |
iterator_range< reg_iterator > | reg_operands (Register Reg) const |
reg_instr_iterator | reg_instr_begin (Register RegNo) const |
iterator_range< reg_instr_iterator > | reg_instructions (Register Reg) const |
reg_bundle_iterator | reg_bundle_begin (Register RegNo) const |
iterator_range< reg_bundle_iterator > | reg_bundles (Register Reg) const |
bool | reg_empty (Register RegNo) const |
reg_empty - Return true if there are no instructions using or defining the specified register (it may be live-in). | |
reg_nodbg_iterator | reg_nodbg_begin (Register RegNo) const |
iterator_range< reg_nodbg_iterator > | reg_nodbg_operands (Register Reg) const |
reg_instr_nodbg_iterator | reg_instr_nodbg_begin (Register RegNo) const |
iterator_range< reg_instr_nodbg_iterator > | reg_nodbg_instructions (Register Reg) const |
reg_bundle_nodbg_iterator | reg_bundle_nodbg_begin (Register RegNo) const |
iterator_range< reg_bundle_nodbg_iterator > | reg_nodbg_bundles (Register Reg) const |
bool | reg_nodbg_empty (Register RegNo) const |
reg_nodbg_empty - Return true if the only instructions using or defining Reg are Debug instructions. | |
def_iterator | def_begin (Register RegNo) const |
iterator_range< def_iterator > | def_operands (Register Reg) const |
def_instr_iterator | def_instr_begin (Register RegNo) const |
iterator_range< def_instr_iterator > | def_instructions (Register Reg) const |
def_bundle_iterator | def_bundle_begin (Register RegNo) const |
iterator_range< def_bundle_iterator > | def_bundles (Register Reg) const |
bool | def_empty (Register RegNo) const |
def_empty - Return true if there are no instructions defining the specified register (it may be live-in). | |
StringRef | getVRegName (Register Reg) const |
void | insertVRegByName (StringRef Name, Register Reg) |
bool | hasOneDef (Register RegNo) const |
Return true if there is exactly one operand defining the specified register. | |
MachineOperand * | getOneDef (Register Reg) const |
Returns the defining operand if there is exactly one operand defining the specified register, otherwise nullptr. | |
use_iterator | use_begin (Register RegNo) const |
iterator_range< use_iterator > | use_operands (Register Reg) const |
use_instr_iterator | use_instr_begin (Register RegNo) const |
iterator_range< use_instr_iterator > | use_instructions (Register Reg) const |
use_bundle_iterator | use_bundle_begin (Register RegNo) const |
iterator_range< use_bundle_iterator > | use_bundles (Register Reg) const |
bool | use_empty (Register RegNo) const |
use_empty - Return true if there are no instructions using the specified register. | |
bool | hasOneUse (Register RegNo) const |
hasOneUse - Return true if there is exactly one instruction using the specified register. | |
use_nodbg_iterator | use_nodbg_begin (Register RegNo) const |
iterator_range< use_nodbg_iterator > | use_nodbg_operands (Register Reg) const |
use_instr_nodbg_iterator | use_instr_nodbg_begin (Register RegNo) const |
iterator_range< use_instr_nodbg_iterator > | use_nodbg_instructions (Register Reg) const |
use_bundle_nodbg_iterator | use_bundle_nodbg_begin (Register RegNo) const |
iterator_range< use_bundle_nodbg_iterator > | use_nodbg_bundles (Register Reg) const |
bool | use_nodbg_empty (Register RegNo) const |
use_nodbg_empty - Return true if there are no non-Debug instructions using the specified register. | |
LLVM_ABI bool | hasOneNonDBGUse (Register RegNo) const |
hasOneNonDBGUse - Return true if there is exactly one non-Debug use of the specified register. | |
LLVM_ABI bool | hasOneNonDBGUser (Register RegNo) const |
hasOneNonDBGUse - Return true if there is exactly one non-Debug instruction using the specified register. | |
LLVM_ABI MachineInstr * | getOneNonDBGUser (Register RegNo) const |
If the register has a single non-Debug instruction using the specified register, returns it; otherwise returns nullptr. | |
LLVM_ABI bool | hasAtMostUserInstrs (Register Reg, unsigned MaxUsers) const |
hasAtMostUses - Return true if the given register has at most MaxUsers non-debug user instructions. | |
LLVM_ABI void | replaceRegWith (Register FromReg, Register ToReg) |
replaceRegWith - Replace all instances of FromReg with ToReg in the machine function. | |
LLVM_ABI MachineInstr * | getVRegDef (Register Reg) const |
getVRegDef - Return the machine instr that defines the specified virtual register or null if none is found. | |
LLVM_ABI MachineInstr * | getUniqueVRegDef (Register Reg) const |
getUniqueVRegDef - Return the unique machine instr that defines the specified virtual register or null if none is found. | |
LLVM_ABI void | clearKillFlags (Register Reg) const |
clearKillFlags - Iterate over all the uses of the given register and clear the kill flag from the MachineOperand. | |
LLVM_ABI void | dumpUses (Register RegNo) const |
LLVM_ABI bool | isConstantPhysReg (MCRegister PhysReg) const |
Returns true if PhysReg is unallocatable and constant throughout the function. | |
PSetIterator | getPressureSets (Register RegUnit) const |
Get an iterator over the pressure sets affected by the given physical or virtual register. | |
const TargetRegisterClass * | getRegClass (Register Reg) const |
Return the register class of the specified virtual register. | |
const TargetRegisterClass * | getRegClassOrNull (Register Reg) const |
Return the register class of Reg , or null if Reg has not been assigned a register class yet. | |
const RegisterBank * | getRegBank (Register Reg) const |
Return the register bank of Reg . | |
const RegisterBank * | getRegBankOrNull (Register Reg) const |
Return the register bank of Reg , or null if Reg has not been assigned a register bank or has been assigned a register class. | |
const RegClassOrRegBank & | getRegClassOrRegBank (Register Reg) const |
Return the register bank or register class of Reg . | |
LLVM_ABI void | setRegClass (Register Reg, const TargetRegisterClass *RC) |
setRegClass - Set the register class of the specified virtual register. | |
LLVM_ABI void | setRegBank (Register Reg, const RegisterBank &RegBank) |
Set the register bank to RegBank for Reg . | |
void | setRegClassOrRegBank (Register Reg, const RegClassOrRegBank &RCOrRB) |
LLVM_ABI const TargetRegisterClass * | constrainRegClass (Register Reg, const TargetRegisterClass *RC, unsigned MinNumRegs=0) |
constrainRegClass - Constrain the register class of the specified virtual register to be a common subclass of RC and the current register class, but only if the new class has at least MinNumRegs registers. | |
LLVM_ABI bool | constrainRegAttrs (Register Reg, Register ConstrainingReg, unsigned MinNumRegs=0) |
Constrain the register class or the register bank of the virtual register Reg (and low-level type) to be a common subclass or a common bank of both registers provided respectively (and a common low-level type). | |
LLVM_ABI bool | recomputeRegClass (Register Reg) |
recomputeRegClass - Try to find a legal super-class of Reg's register class that still satisfies the constraints from the instructions using Reg. | |
LLVM_ABI Register | createVirtualRegister (const TargetRegisterClass *RegClass, StringRef Name="") |
createVirtualRegister - Create and return a new virtual register in the function with the specified register class. | |
VRegAttrs | getVRegAttrs (Register Reg) const |
Returns register class or bank and low level type of Reg . | |
LLVM_ABI Register | createVirtualRegister (VRegAttrs RegAttr, StringRef Name="") |
Create and return a new virtual register in the function with the specified register attributes(register class or bank and low level type). | |
LLVM_ABI Register | cloneVirtualRegister (Register VReg, StringRef Name="") |
Create and return a new virtual register in the function with the same attributes as the given register. | |
LLT | getType (Register Reg) const |
Get the low-level type of Reg or LLT{} if Reg is not a generic (target independent) virtual register. | |
LLVM_ABI void | setType (Register VReg, LLT Ty) |
Set the low-level type of VReg to Ty . | |
LLVM_ABI Register | createGenericVirtualRegister (LLT Ty, StringRef Name="") |
Create and return a new generic virtual register with low-level type Ty . | |
LLVM_ABI void | clearVirtRegTypes () |
Remove all types associated to virtual registers (after instruction selection and constraining of all generic virtual registers). | |
LLVM_ABI Register | createIncompleteVirtualRegister (StringRef Name="") |
Creates a new virtual register that has no register class, register bank or size assigned yet. | |
unsigned | getNumVirtRegs () const |
getNumVirtRegs - Return the number of virtual registers created. | |
LLVM_ABI void | clearVirtRegs () |
clearVirtRegs - Remove all virtual registers (after physreg assignment). | |
void | setRegAllocationHint (Register VReg, unsigned Type, Register PrefReg) |
setRegAllocationHint - Specify a register allocation hint for the specified virtual register. | |
void | addRegAllocationHint (Register VReg, Register PrefReg) |
addRegAllocationHint - Add a register allocation hint to the hints vector for VReg. | |
void | setSimpleHint (Register VReg, Register PrefReg) |
Specify the preferred (target independent) register allocation hint for the specified virtual register. | |
void | clearSimpleHint (Register VReg) |
std::pair< unsigned, Register > | getRegAllocationHint (Register VReg) const |
getRegAllocationHint - Return the register allocation hint for the specified virtual register. | |
Register | getSimpleHint (Register VReg) const |
getSimpleHint - same as getRegAllocationHint except it will only return a target independent hint. | |
const std::pair< unsigned, SmallVector< Register, 4 > > * | getRegAllocationHints (Register VReg) const |
getRegAllocationHints - Return a reference to the vector of all register allocation hints for VReg. | |
LLVM_ABI void | markUsesInDebugValueAsUndef (Register Reg) const |
markUsesInDebugValueAsUndef - Mark every DBG_VALUE referencing the specified register as undefined which causes the DBG_VALUE to be deleted during LiveDebugVariables analysis. | |
void | updateDbgUsersToReg (MCRegister OldReg, MCRegister NewReg, ArrayRef< MachineInstr * > Users) const |
updateDbgUsersToReg - Update a collection of debug instructions to refer to the designated register. | |
LLVM_ABI bool | isPhysRegModified (MCRegister PhysReg, bool SkipNoReturnDef=false) const |
Return true if the specified register is modified in this function. | |
LLVM_ABI bool | isPhysRegUsed (MCRegister PhysReg, bool SkipRegMaskTest=false) const |
Return true if the specified register is modified or read in this function. | |
void | addPhysRegsUsedFromRegMask (const uint32_t *RegMask) |
addPhysRegsUsedFromRegMask - Mark any registers not in RegMask as used. | |
const BitVector & | getUsedPhysRegsMask () const |
LLVM_ABI void | freezeReservedRegs () |
freezeReservedRegs - Called by the register allocator to freeze the set of reserved registers before allocation begins. | |
void | reserveReg (MCRegister PhysReg, const TargetRegisterInfo *TRI) |
reserveReg – Mark a register as reserved so checks like isAllocatable will not suggest using it. | |
bool | reservedRegsFrozen () const |
reservedRegsFrozen - Returns true after freezeReservedRegs() was called to ensure the set of reserved registers stays constant. | |
bool | canReserveReg (MCRegister PhysReg) const |
canReserveReg - Returns true if PhysReg can be used as a reserved register. | |
const BitVector & | getReservedRegs () const |
getReservedRegs - Returns a reference to the frozen set of reserved registers. | |
bool | isReserved (MCRegister PhysReg) const |
isReserved - Returns true when PhysReg is a reserved register. | |
LLVM_ABI bool | isReservedRegUnit (unsigned Unit) const |
Returns true when the given register unit is considered reserved. | |
bool | isAllocatable (MCRegister PhysReg) const |
isAllocatable - Returns true when PhysReg belongs to an allocatable register class and it hasn't been reserved. | |
void | addLiveIn (MCRegister Reg, Register vreg=Register()) |
addLiveIn - Add the specified register as a live-in. | |
livein_iterator | livein_begin () const |
livein_iterator | livein_end () const |
bool | livein_empty () const |
ArrayRef< std::pair< MCRegister, Register > > | liveins () const |
LLVM_ABI bool | isLiveIn (Register Reg) const |
LLVM_ABI MCRegister | getLiveInPhysReg (Register VReg) const |
getLiveInPhysReg - If VReg is a live-in virtual register, return the corresponding live-in physical register. | |
LLVM_ABI Register | getLiveInVirtReg (MCRegister PReg) const |
getLiveInVirtReg - If PReg is a live-in physical register, return the corresponding live-in virtual register. | |
LLVM_ABI void | EmitLiveInCopies (MachineBasicBlock *EntryMBB, const TargetRegisterInfo &TRI, const TargetInstrInfo &TII) |
EmitLiveInCopies - Emit copies to initialize livein virtual registers into the given entry block. | |
LLVM_ABI LaneBitmask | getMaxLaneMaskForVReg (Register Reg) const |
Returns a mask covering all bits that can appear in lane masks of subregisters of the virtual register Reg . | |
Static Public Member Functions | |
static reg_iterator | reg_end () |
static reg_instr_iterator | reg_instr_end () |
static reg_bundle_iterator | reg_bundle_end () |
static reg_nodbg_iterator | reg_nodbg_end () |
static reg_instr_nodbg_iterator | reg_instr_nodbg_end () |
static reg_bundle_nodbg_iterator | reg_bundle_nodbg_end () |
static def_iterator | def_end () |
static def_instr_iterator | def_instr_end () |
static def_bundle_iterator | def_bundle_end () |
static use_iterator | use_end () |
static use_instr_iterator | use_instr_end () |
static use_bundle_iterator | use_bundle_end () |
static use_nodbg_iterator | use_nodbg_end () |
static use_instr_nodbg_iterator | use_instr_nodbg_end () |
static use_bundle_nodbg_iterator | use_bundle_nodbg_end () |
Friends | |
template<bool , bool , bool , bool , bool > | |
class | defusechain_iterator |
template<bool , bool , bool , bool > | |
class | defusechain_instr_iterator |
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Definition at line 53 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::def_bundle_iterator = defusechain_instr_iterator<false, true, false, false> |
def_bundle_iterator/def_bundle_begin/def_bundle_end - Walk all defs of the specified register, stepping by bundle.
Definition at line 415 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::def_instr_iterator = defusechain_instr_iterator<false, true, false, true> |
def_instr_iterator/def_instr_begin/def_instr_end - Walk all defs of the specified register, stepping by MachineInst.
Definition at line 399 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::def_iterator = defusechain_iterator<false, true, false, true, false> |
def_iterator/def_begin/def_end - Walk all defs of the specified register.
Definition at line 387 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::livein_iterator = std::vector<std::pair<MCRegister,Register> >::const_iterator |
Definition at line 1006 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::reg_bundle_iterator = defusechain_instr_iterator<true, true, false, false> |
reg_bundle_iterator/reg_bundle_begin/reg_bundle_end - Walk all defs and uses of the specified register, stepping by bundle.
Definition at line 313 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::reg_bundle_nodbg_iterator = defusechain_instr_iterator<true, true, true, false> |
reg_bundle_nodbg_iterator/reg_bundle_nodbg_begin/reg_bundle_nodbg_end - Walk all defs and uses of the specified register, stepping by bundle, skipping those marked as Debug.
Definition at line 366 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::reg_instr_iterator = defusechain_instr_iterator<true, true, false, true> |
reg_instr_iterator/reg_instr_begin/reg_instr_end - Walk all defs and uses of the specified register, stepping by MachineInstr.
Definition at line 297 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::reg_instr_nodbg_iterator = defusechain_instr_iterator<true, true, true, true> |
reg_instr_nodbg_iterator/reg_instr_nodbg_begin/reg_instr_nodbg_end - Walk all defs and uses of the specified register, stepping by MachineInstr, skipping those marked as Debug.
Definition at line 349 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::reg_iterator = defusechain_iterator<true, true, false, true, false> |
reg_iterator/reg_begin/reg_end - Walk all defs and uses of the specified register.
Definition at line 285 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::reg_nodbg_iterator = defusechain_iterator<true, true, true, true, false> |
reg_nodbg_iterator/reg_nodbg_begin/reg_nodbg_end - Walk all defs and uses of the specified register, skipping those marked as Debug.
Definition at line 332 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::use_bundle_iterator = defusechain_instr_iterator<true, false, false, false> |
use_bundle_iterator/use_bundle_begin/use_bundle_end - Walk all uses of the specified register, stepping by bundle.
Definition at line 494 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::use_bundle_nodbg_iterator = defusechain_instr_iterator<true, false, true, false> |
use_bundle_nodbg_iterator/use_bundle_nodbg_begin/use_bundle_nodbg_end - Walk all uses of the specified register, stepping by bundle, skipping those marked as Debug.
Definition at line 553 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::use_instr_iterator = defusechain_instr_iterator<true, false, false, true> |
use_instr_iterator/use_instr_begin/use_instr_end - Walk all uses of the specified register, stepping by MachineInstr.
Definition at line 478 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::use_instr_nodbg_iterator = defusechain_instr_iterator<true, false, true, true> |
use_instr_nodbg_iterator/use_instr_nodbg_begin/use_instr_nodbg_end - Walk all uses of the specified register, stepping by MachineInstr, skipping those marked as Debug.
Definition at line 536 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::use_iterator = defusechain_iterator<true, false, false, true, false> |
use_iterator/use_begin/use_end - Walk all uses of the specified register.
Definition at line 466 of file MachineRegisterInfo.h.
using llvm::MachineRegisterInfo::use_nodbg_iterator = defusechain_iterator<true, false, true, true, false> |
use_nodbg_iterator/use_nodbg_begin/use_nodbg_end - Walk all uses of the specified register, skipping those marked as Debug.
Definition at line 519 of file MachineRegisterInfo.h.
|
explicit |
Definition at line 43 of file MachineRegisterInfo.cpp.
References llvm::MCRegisterInfo::getNumRegs(), getTargetRegisterInfo(), and llvm::BitVector::resize().
|
delete |
|
inline |
Definition at line 171 of file MachineRegisterInfo.h.
References assert(), llvm::SmallPtrSetImpl< PtrType >::count(), and llvm::SmallPtrSetImpl< PtrType >::insert().
Referenced by llvm::GCNTargetMachine::registerMachineRegisterInfoCallback().
|
inline |
addLiveIn - Add the specified register as a live-in.
Note that it is an error to add the same register to the same set more than once.
Definition at line 1000 of file MachineRegisterInfo.h.
References Reg.
Referenced by addLiveIn(), buildGitPtr(), llvm::MipsFunctionInfo::initGlobalBaseReg(), llvm::LoongArchTargetLowering::LowerFormalArguments(), llvm::RISCVTargetLowering::LowerFormalArguments(), llvm::XtensaTargetLowering::LowerFormalArguments(), llvm::SparcTargetLowering::LowerFormalArguments_32(), and llvm::MIRParserImpl::parseRegisterInfo().
addPhysRegsUsedFromRegMask - Mark any registers not in RegMask as used.
This corresponds to the bit mask attached to register mask operands.
Definition at line 910 of file MachineRegisterInfo.h.
addRegAllocationHint - Add a register allocation hint to the hints vector for VReg.
Definition at line 812 of file MachineRegisterInfo.h.
References assert(), getNumVirtRegs(), llvm::IndexedMap< T, ToIndexT >::grow(), llvm::Register::index2VirtReg(), and llvm::Register::isVirtual().
void MachineRegisterInfo::addRegOperandToUseList | ( | MachineOperand * | MO | ) |
Add MO to the linked list of operands for its register.
Definition at line 273 of file MachineRegisterInfo.cpp.
References assert(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDef(), and llvm::Last.
Referenced by llvm::MachineOperand::ChangeToRegister().
|
inline |
canReserveReg - Returns true if PhysReg can be used as a reserved register.
Any register can be reserved before freezeReservedRegs() is called.
Definition at line 953 of file MachineRegisterInfo.h.
References llvm::MCRegister::id(), and reservedRegsFrozen().
Referenced by llvm::MipsRegisterInfo::canRealignStack().
void MachineRegisterInfo::clearKillFlags | ( | Register | Reg | ) | const |
clearKillFlags - Iterate over all the uses of the given register and clear the kill flag from the MachineOperand.
This function is used by optimization passes which extend register lifetimes and need only preserve conservative kill flag information.
Definition at line 450 of file MachineRegisterInfo.cpp.
References use_operands().
Referenced by llvm::SITargetLowering::EmitInstrWithCustomInserter().
|
inline |
Definition at line 824 of file MachineRegisterInfo.h.
References assert(), llvm::IndexedMap< T, ToIndexT >::clear(), and llvm::IndexedMap< T, ToIndexT >::inBounds().
void MachineRegisterInfo::clearVirtRegs | ( | ) |
clearVirtRegs - Remove all virtual registers (after physreg assignment).
Definition at line 206 of file MachineRegisterInfo.cpp.
References llvm::errs(), getNumVirtRegs(), getTargetRegisterInfo(), I, llvm::Register::index2VirtReg(), MI, llvm::printReg(), reg_instructions(), and verifyUseList().
void MachineRegisterInfo::clearVirtRegTypes | ( | ) |
Remove all types associated to virtual registers (after instruction selection and constraining of all generic virtual registers).
Definition at line 203 of file MachineRegisterInfo.cpp.
References llvm::IndexedMap< T, ToIndexT >::clear().
Create and return a new virtual register in the function with the same attributes as the given register.
Definition at line 178 of file MachineRegisterInfo.cpp.
References createIncompleteVirtualRegister(), getType(), Name, noteCloneVirtualRegister(), and setType().
Referenced by llvm::CombinerHelper::applyCombineConcatVectors(), llvm::CombinerHelper::applyCombineExtendingLoads(), llvm::CombinerHelper::applyCombineShuffleVector(), llvm::LiveRangeEdit::createFrom(), and llvm::CombinerHelper::matchLoadOrCombine().
bool MachineRegisterInfo::constrainRegAttrs | ( | Register | Reg, |
Register | ConstrainingReg, | ||
unsigned | MinNumRegs = 0 |
||
) |
Constrain the register class or the register bank of the virtual register Reg
(and low-level type) to be a common subclass or a common bank of both registers provided respectively (and a common low-level type).
Do nothing if any of the attributes (classes, banks, or low-level types) of the registers are deemed incompatible, or if the resulting register will have a class smaller than before and of size less than MinNumRegs
. Return true if such register attributes exist, false otherwise.
Definition at line 92 of file MachineRegisterInfo.cpp.
References constrainRegClass(), getRegClassOrRegBank(), getType(), llvm::LLT::isValid(), setRegClassOrRegBank(), and setType().
Referenced by llvm::CombinerHelper::replaceRegWith().
const TargetRegisterClass * MachineRegisterInfo::constrainRegClass | ( | Register | Reg, |
const TargetRegisterClass * | RC, | ||
unsigned | MinNumRegs = 0 |
||
) |
constrainRegClass - Constrain the register class of the specified virtual register to be a common subclass of RC and the current register class, but only if the new class has at least MinNumRegs registers.
Return the new register class, or NULL if no such class exists. This should only be used when the constraint is known to be trivial, like GR32 -> GR32_NOSP. Beware of increasing register pressure.
Definition at line 84 of file MachineRegisterInfo.cpp.
References getRegClass().
Referenced by llvm::X86InstrInfo::classifyLEAReg(), llvm::FastISel::constrainOperandRegClass(), constrainRegAttrs(), llvm::X86InstrInfo::convertToThreeAddress(), llvm::SIRegisterInfo::eliminateFrameIndex(), llvm::FastISel::fastEmitInst_extractsubreg(), llvm::AArch64InstrInfo::foldMemoryOperandImpl(), llvm::AArch64InstrInfo::loadRegFromStackSlot(), llvm::MachineSSAUpdater::RewriteUse(), llvm::AArch64InstrInfo::storeRegToStackSlot(), and llvm::TailDuplicator::tailDuplicateAndUpdate().
Create and return a new generic virtual register with low-level type Ty
.
Definition at line 193 of file MachineRegisterInfo.cpp.
References createIncompleteVirtualRegister(), Name, noteNewVirtualRegister(), and setType().
Referenced by llvm::AMDGPUCombinerHelper::applyFoldableFneg(), llvm::buildBoolRegister(), llvm::MachineIRBuilder::buildMaskLowPtrBits(), llvm::SPIRVGlobalRegistry::createConstFP(), llvm::SPIRVGlobalRegistry::createConstInt(), llvm::generateImageSizeQueryInst(), llvm::SPIRVGlobalRegistry::getOrCreateConstNullPtr(), llvm::SPIRVGlobalRegistry::getOrCreateUndef(), llvm::AArch64LegalizerInfo::legalizeIntrinsic(), llvm::MipsCallLowering::lowerCall(), llvm::CombinerHelper::matchCombineFAddFMAFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFSubFpExtFNegFMulToFMadOrFMA(), llvm::CombinerHelper::matchHoistLogicOpWithSameOpcodeHands(), and llvm::MachineIRBuilder::materializePtrAdd().
Creates a new virtual register that has no register class, register bank or size assigned yet.
This is only allowed to be used temporarily while constructing machine instructions. Most operations are undefined on an incomplete register until one of setRegClass(), setRegBank() or setSize() has been called on it.
Definition at line 145 of file MachineRegisterInfo.cpp.
References getNumVirtRegs(), llvm::Register::index2VirtReg(), insertVRegByName(), and Name.
Referenced by cloneVirtualRegister(), createGenericVirtualRegister(), createVirtualRegister(), and llvm::PerFunctionMIParsingState::getVRegInfoNamed().
Register MachineRegisterInfo::createVirtualRegister | ( | const TargetRegisterClass * | RegClass, |
StringRef | Name = "" |
||
) |
createVirtualRegister - Create and return a new virtual register in the function with the specified register class.
Definition at line 156 of file MachineRegisterInfo.cpp.
References assert(), createIncompleteVirtualRegister(), llvm::TargetRegisterClass::isAllocatable(), Name, and noteNewVirtualRegister().
Referenced by addLiveIn(), llvm::XtensaInstrInfo::adjustStackPtr(), llvm::buildBuiltinVariableLoad(), llvm::SPIRVGlobalRegistry::buildConstantSampler(), llvm::X86InstrInfo::classifyLEAReg(), llvm::SwiftErrorValueTracking::createEntriesInEntryBlock(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), llvm::FunctionLoweringInfo::CreateReg(), llvm::FastISel::createResultReg(), llvm::AArch64FrameLowering::eliminateCallFramePseudoInstr(), llvm::AArch64RegisterInfo::eliminateFrameIndex(), llvm::ARMBaseRegisterInfo::eliminateFrameIndex(), llvm::ThumbRegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::SystemZRegisterInfo::eliminateFrameIndex(), llvm::PPCTargetLowering::EmitAtomicBinary(), llvm::RISCVTargetLowering::emitDynamicProbedAlloc(), emitFrameOffsetAdj(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::X86TargetLowering::EmitInstrWithCustomInserter(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::CSKYFrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::RISCVFrameLowering::emitPrologue(), llvm::MSP430TargetLowering::EmitShiftInstr(), emitThumbRegPlusImmInReg(), llvm::WindowScheduler::generateTripleMBB(), llvm::MipsFunctionInfo::getGlobalBaseReg(), llvm::M68kInstrInfo::getGlobalBaseReg(), llvm::SparcInstrInfo::getGlobalBaseReg(), llvm::X86InstrInfo::getGlobalBaseReg(), llvm::SPIRVGlobalRegistry::getOrCreateGlobalVariableWithBinding(), llvm::SwiftErrorValueTracking::getOrCreateVReg(), llvm::SwiftErrorValueTracking::getOrCreateVRegDefAt(), llvm::MipsFunctionInfo::initGlobalBaseReg(), llvm::MipsSEInstrInfo::loadImmediate(), llvm::XtensaInstrInfo::loadImmediate(), llvm::X86InstrInfo::loadStoreTileReg(), llvm::SPIRVCallLowering::lowerCall(), LowerCallResults(), llvm::PPCRegisterInfo::lowerCRBitRestore(), llvm::PPCRegisterInfo::lowerCRBitSpilling(), llvm::PPCRegisterInfo::lowerCRRestore(), llvm::PPCRegisterInfo::lowerCRSpilling(), llvm::PPCRegisterInfo::lowerDMRRestore(), llvm::PPCRegisterInfo::lowerDMRSpilling(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::LoongArchTargetLowering::LowerFormalArguments(), llvm::RISCVTargetLowering::LowerFormalArguments(), llvm::XtensaTargetLowering::LowerFormalArguments(), llvm::SparcTargetLowering::LowerFormalArguments_32(), llvm::PPCRegisterInfo::lowerWACCRestore(), llvm::PPCRegisterInfo::lowerWACCSpilling(), llvm::RISCVRegisterInfo::materializeFrameBaseRegister(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), llvm::PPCRegisterInfo::prepareDynamicAlloca(), llvm::SwiftErrorValueTracking::propagateVRegs(), and llvm::ThumbRegisterInfo::rewriteFrameIndex().
Create and return a new virtual register in the function with the specified register attributes(register class or bank and low level type).
Definition at line 169 of file MachineRegisterInfo.cpp.
References createIncompleteVirtualRegister(), Name, noteNewVirtualRegister(), llvm::MachineRegisterInfo::VRegAttrs::RCOrRB, setType(), and llvm::MachineRegisterInfo::VRegAttrs::Ty.
|
inline |
Definition at line 388 of file MachineRegisterInfo.h.
Referenced by def_empty(), def_operands(), getOneDef(), isPhysRegModified(), and MustSaveLR().
|
inline |
Definition at line 417 of file MachineRegisterInfo.h.
Referenced by def_bundles().
|
inlinestatic |
Definition at line 420 of file MachineRegisterInfo.h.
Referenced by def_bundles().
|
inline |
Definition at line 424 of file MachineRegisterInfo.h.
References def_bundle_begin(), def_bundle_end(), llvm::make_range(), and Reg.
def_empty - Return true if there are no instructions defining the specified register (it may be live-in).
Definition at line 430 of file MachineRegisterInfo.h.
References def_begin(), and def_end().
Referenced by getUniqueVRegDef(), and isConstantPhysReg().
|
inlinestatic |
Definition at line 391 of file MachineRegisterInfo.h.
Referenced by def_empty(), def_operands(), getOneDef(), isPhysRegModified(), and MustSaveLR().
|
inline |
Definition at line 401 of file MachineRegisterInfo.h.
Referenced by def_instructions(), llvm::InstrEmitter::EmitDbgInstrRef(), llvm::MachineFunction::finalizeDebugInstrRefs(), getUniqueVRegDef(), and getVRegDef().
|
inlinestatic |
Definition at line 404 of file MachineRegisterInfo.h.
Referenced by def_instructions(), getUniqueVRegDef(), and getVRegDef().
|
inline |
Definition at line 409 of file MachineRegisterInfo.h.
References def_instr_begin(), def_instr_end(), llvm::make_range(), and Reg.
|
inline |
Definition at line 393 of file MachineRegisterInfo.h.
References def_begin(), def_end(), llvm::make_range(), and Reg.
Referenced by hasOneDef(), and hasTiedDef().
void MachineRegisterInfo::disableCalleeSavedRegister | ( | MCRegister | Reg | ) |
Disables the register from the list of CSRs.
I.e. the register will not appear as part of the CSR mask.
Definition at line 617 of file MachineRegisterInfo.cpp.
References assert(), llvm::erase(), getTargetRegisterInfo(), I, llvm::MCRegAliasIterator::isValid(), and TRI.
Referenced by getCalleeSavedRegs().
LLVM_DUMP_METHOD void MachineRegisterInfo::dumpUses | ( | Register | RegNo | ) | const |
Definition at line 520 of file MachineRegisterInfo.cpp.
References I, and use_instructions().
void MachineRegisterInfo::EmitLiveInCopies | ( | MachineBasicBlock * | EntryMBB, |
const TargetRegisterInfo & | TRI, | ||
const TargetInstrInfo & | TII | ||
) |
EmitLiveInCopies - Emit copies to initialize livein virtual registers into the given entry block.
Definition at line 483 of file MachineRegisterInfo.cpp.
References llvm::MachineBasicBlock::addLiveIn(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), TII, and use_nodbg_empty().
Referenced by llvm::SelectionDAGISel::runOnMachineFunction().
void MachineRegisterInfo::freezeReservedRegs | ( | ) |
freezeReservedRegs - Called by the register allocator to freeze the set of reserved registers before allocation begins.
Definition at line 526 of file MachineRegisterInfo.cpp.
References assert(), llvm::TargetRegisterInfo::getReservedRegs(), getTargetRegisterInfo(), and llvm::BitVector::size().
Referenced by createFrameHelperMachineFunction(), llvm::TargetLoweringBase::finalizeLowering(), and llvm::RegAllocBase::init().
Returns list of callee saved registers.
The function returns the updated CSR list (after taking into account registers that are disabled from the CSR list).
Definition at line 640 of file MachineRegisterInfo.cpp.
References disableCalleeSavedRegister(), llvm::TargetRegisterInfo::getCalleeSavedRegs(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), getTargetRegisterInfo(), I, and llvm::TargetSubtargetInfo::isRegisterReservedByUser().
Referenced by llvm::AArch64FrameLowering::determineCalleeSaves(), llvm::CSKYFrameLowering::determineCalleeSaves(), llvm::TargetFrameLowering::determineCalleeSaves(), llvm::SIFrameLowering::determinePrologEpilogSGPRSaves(), llvm::VETargetLowering::emitSjLjDispatchBlock(), getLiveRegsForEntryMBB(), isACalleeSavedRegister(), llvm::X86MachineFunctionInfo::setRestoreBasePointer(), llvm::SIMachineFunctionInfo::splitWWMSpillRegisters(), llvm::AggressiveAntiDepBreaker::StartBlock(), and llvm::CriticalAntiDepBreaker::StartBlock().
MCRegister MachineRegisterInfo::getLiveInPhysReg | ( | Register | VReg | ) | const |
getLiveInPhysReg - If VReg is a live-in virtual register, return the corresponding live-in physical register.
Definition at line 464 of file MachineRegisterInfo.cpp.
References liveins().
Register MachineRegisterInfo::getLiveInVirtReg | ( | MCRegister | PReg | ) | const |
getLiveInVirtReg - If PReg is a live-in physical register, return the corresponding live-in virtual register.
getLiveInVirtReg - If PReg is a live-in physical register, return the corresponding live-in physical register.
Definition at line 473 of file MachineRegisterInfo.cpp.
References liveins().
LaneBitmask MachineRegisterInfo::getMaxLaneMaskForVReg | ( | Register | Reg | ) | const |
Returns a mask covering all bits that can appear in lane masks of subregisters of the virtual register Reg
.
Definition at line 512 of file MachineRegisterInfo.cpp.
References assert(), llvm::TargetRegisterClass::getLaneMask(), and getRegClass().
Referenced by llvm::LiveIntervals::addKillFlags(), llvm::LiveRangeEdit::allUsesAvailableAt(), getInstReadLaneMask(), and llvm::DeadLaneDetector::transferDefinedLanes().
|
inline |
Definition at line 189 of file MachineRegisterInfo.h.
|
inline |
getNumVirtRegs - Return the number of virtual registers created.
Definition at line 793 of file MachineRegisterInfo.h.
Referenced by llvm::LiveIntervals::addKillFlags(), llvm::LiveVariables::addNewBlock(), addRegAllocationHint(), llvm::ScheduleDAGInstrs::buildSchedGraph(), clearVirtRegs(), createIncompleteVirtualRegister(), llvm::VirtRegMap::grow(), llvm::RegPressureTracker::init(), llvm::ScheduleDAGMILive::initRegPressure(), llvm::SPIRV::lowerBuiltinType(), llvm::LiveIntervals::print(), llvm::VirtRegMap::print(), setRegAllocationHint(), and verifyUseLists().
|
inline |
Returns the defining operand if there is exactly one operand defining the specified register, otherwise nullptr.
Definition at line 454 of file MachineRegisterInfo.h.
References def_begin(), def_end(), and Reg.
MachineInstr * MachineRegisterInfo::getOneNonDBGUser | ( | Register | RegNo | ) | const |
If the register has a single non-Debug instruction using the specified register, returns it; otherwise returns nullptr.
Definition at line 435 of file MachineRegisterInfo.cpp.
References llvm::hasSingleElement(), and use_nodbg_instructions().
|
inline |
Get an iterator over the pressure sets affected by the given physical or virtual register.
If RegUnit is physical, it must be a register unit (from MCRegUnitIterator).
Definition at line 1277 of file MachineRegisterInfo.h.
Referenced by llvm::SIScheduleDAGMI::fillVgprSgprCost(), and llvm::RegPressureTracker::increaseRegPressure().
|
inline |
getRegAllocationHint - Return the register allocation hint for the specified virtual register.
If there are many hints, this returns the one with the greatest weight.
Definition at line 834 of file MachineRegisterInfo.h.
References assert(), llvm::Register::id(), llvm::IndexedMap< T, ToIndexT >::inBounds(), and llvm::Register::isVirtual().
Referenced by getSimpleHint(), and llvm::VirtRegMap::hasKnownPreference().
|
inline |
getRegAllocationHints - Return a reference to the vector of all register allocation hints for VReg.
Definition at line 854 of file MachineRegisterInfo.h.
References assert(), llvm::IndexedMap< T, ToIndexT >::inBounds(), and llvm::Register::isVirtual().
|
inline |
Return the register bank of Reg
.
This shouldn't be used directly unless Reg
has a register bank.
Definition at line 669 of file MachineRegisterInfo.h.
References Reg.
|
inline |
Return the register bank of Reg
, or null if Reg has not been assigned a register bank or has been assigned a register class.
Definition at line 677 of file MachineRegisterInfo.h.
References Reg.
Referenced by AMDGPURegBankLegalizeCombiner::isLaneMask(), llvm::printRegClassOrBank(), AMDGPURegBankLegalizeCombiner::tryCombineCopy(), and AMDGPURegBankLegalizeCombiner::tryEliminateReadAnyLane().
|
inline |
Return the register class of the specified virtual register.
This shouldn't be used directly unless Reg
has a register class.
Definition at line 645 of file MachineRegisterInfo.h.
Referenced by llvm::RegAllocBase::allocatePhysRegs(), llvm::VirtRegMap::assignVirt2StackSlot(), llvm::LiveRangeEdit::calculateRegClassAndHint(), constrainRegClass(), llvm::AllocationOrder::create(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), llvm::PPCTargetLowering::EmitInstrWithCustomInserter(), llvm::HexagonEvaluator::evaluate(), llvm::FastISel::fastEmitInst_extractsubreg(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), foldPatchpoint(), llvm::WindowScheduler::generateTripleMBB(), llvm::BitTracker::MachineEvaluator::getCell(), GetCostForDef(), llvm::ScheduleDAGInstrs::getLaneMaskForMO(), getMaxLaneMaskForVReg(), llvm::RegAllocEvictionAdvisor::getOrderLimit(), llvm::BitTracker::MachineEvaluator::getRegBitWidth(), getRegTy(), llvm::WebAssemblyAsmPrinter::getRegType(), llvm::NVPTXAsmPrinter::getVirtualRegisterName(), isNonFoldablePartialRegisterLoad(), llvm::HexagonEvaluator::mask(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), llvm::VirtRegMap::print(), llvm::printRegClassOrBank(), recomputeRegClass(), llvm::PeelingModuloScheduleExpander::rewriteUsesOf(), llvm::TailDuplicator::tailDuplicateAndUpdate(), and llvm::DeadLaneDetector::transferUsedLanes().
|
inline |
Return the register class of Reg
, or null if Reg has not been assigned a register class yet.
Definition at line 662 of file MachineRegisterInfo.h.
References Reg.
Referenced by getRegClass(), AMDGPURegBankLegalizeCombiner::isLaneMask(), llvm::printRegClassOrBank(), shouldTrackSubRegLiveness(), and AMDGPURegBankLegalizeCombiner::tryEliminateReadAnyLane().
|
inline |
Return the register bank or register class of Reg
.
Reg
may not have either. Definition at line 685 of file MachineRegisterInfo.h.
References Reg.
Referenced by llvm::CombinerHelper::applyCombineUnmergeMergeToPlainValues(), constrainRegAttrs(), and getVRegAttrs().
getReservedRegs - Returns a reference to the frozen set of reserved registers.
This method should always be preferred to calling TRI::getReservedRegs() when possible.
Definition at line 960 of file MachineRegisterInfo.h.
References assert(), and reservedRegsFrozen().
Referenced by isReserved(), and llvm::RegisterClassInfo::runOnMachineFunction().
getSimpleHint - same as getRegAllocationHint except it will only return a target independent hint.
Definition at line 845 of file MachineRegisterInfo.h.
References assert(), getRegAllocationHint(), and llvm::Register::isVirtual().
Referenced by llvm::VirtRegMap::hasPreferredPhys().
|
inline |
Definition at line 159 of file MachineRegisterInfo.h.
References llvm::TargetSubtargetInfo::getRegisterInfo(), and llvm::MachineFunction::getSubtarget().
Referenced by llvm::LiveRangeEdit::allUsesAvailableAt(), clearVirtRegs(), llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), disableCalleeSavedRegister(), llvm::PeelingModuloScheduleExpander::filterInstructions(), freezeReservedRegs(), getCalleeSavedRegs(), isAllocatable(), isConstantPhysReg(), isPhysRegModified(), isPhysRegUsed(), isReservedRegUnit(), llvm::GCNUpwardRPTracker::isValid(), MachineRegisterInfo(), recomputeRegClass(), replaceRegWith(), llvm::PeelingModuloScheduleExpander::rewriteUsesOf(), llvm::tryFoldSPUpdateIntoPushPop(), updateDbgUsersToReg(), verifyUseList(), and verifyUseLists().
Get the low-level type of Reg
or LLT{} if Reg is not a generic (target independent) virtual register.
Definition at line 768 of file MachineRegisterInfo.h.
References Reg.
Referenced by llvm::CombinerHelper::applyAshShlToSextInreg(), llvm::CombinerHelper::applyCombineAddP2IToPtrAdd(), llvm::CombinerHelper::applyCombineExtendingLoads(), llvm::CombinerHelper::applyCombineIndexedLoadStore(), llvm::CombinerHelper::applyCombineInsertVecElts(), llvm::CombinerHelper::applyCombineMulToShl(), llvm::CombinerHelper::applyCombineShiftToUnmerge(), llvm::CombinerHelper::applyCombineShlOfExtend(), llvm::CombinerHelper::applyCombineShuffleConcat(), llvm::CombinerHelper::applyCombineShuffleToBuildVector(), llvm::CombinerHelper::applyCombineTruncOfShift(), llvm::CombinerHelper::applyCombineUnmergeMergeToPlainValues(), llvm::CombinerHelper::applyCombineUnmergeZExtToZExt(), llvm::CombinerHelper::applyExpandFPowI(), llvm::AMDGPUCombinerHelper::applyExpandPromotedF16FMed3(), llvm::CombinerHelper::applyExtendThroughPhis(), llvm::CombinerHelper::applyExtractVecEltBuildVec(), llvm::AMDGPUCombinerHelper::applyFoldableFneg(), llvm::CombinerHelper::applyFoldBinOpIntoSelect(), llvm::CombinerHelper::applyFsubToFneg(), llvm::CombinerHelper::applyFunnelShiftConstantModulo(), llvm::CombinerHelper::applyOptBrCondByInvertingCond(), llvm::CombinerHelper::applyPtrAddImmedChain(), llvm::CombinerHelper::applyRotateOutOfRange(), llvm::CombinerHelper::applySDivByPow2(), llvm::CombinerHelper::applyShiftImmedChain(), llvm::CombinerHelper::applyShiftOfShiftedLogic(), llvm::CombinerHelper::applyShuffleToExtract(), llvm::CombinerHelper::applySimplifyURemByPow2(), llvm::CombinerHelper::applyUDivByPow2(), llvm::CombinerHelper::applyUMulHToLShr(), llvm::CombinerHelper::applyUseVectorTruncate(), llvm::CombinerHelper::applyXorOfAndWithSameReg(), llvm::CombinerHelper::buildSDivOrSRemUsingMul(), llvm::CombinerHelper::buildUDivOrURemUsingMul(), llvm::CombinerHelper::canCombineFMadOrFMA(), cloneVirtualRegister(), llvm::GISelValueTracking::computeKnownBitsImpl(), llvm::GISelValueTracking::computeKnownFPClass(), llvm::RegBankSelect::computeMapping(), llvm::GISelValueTracking::computeNumSignBits(), constrainRegAttrs(), llvm::GISelValueTracking::getKnownBits(), AMDGPURegBankLegalizeCombiner::getReadAnyLaneSrc(), llvm::GISelValueTracking::getValidShiftAmountRange(), getVRegAttrs(), AMDGPURegBankLegalizeCombiner::isLaneMask(), llvm::CombinerHelper::matchAddOverflow(), llvm::CombinerHelper::matchAndOrDisjointMask(), llvm::CombinerHelper::matchAshrShlToSextInreg(), llvm::CombinerHelper::matchBitfieldExtractFromAnd(), llvm::CombinerHelper::matchBitfieldExtractFromSExtInReg(), llvm::CombinerHelper::matchBitfieldExtractFromShr(), llvm::CombinerHelper::matchBitfieldExtractFromShrAnd(), llvm::CombinerHelper::matchBuildVectorIdentityFold(), llvm::CombinerHelper::matchCastOfBuildVector(), llvm::CombinerHelper::matchCastOfInteger(), llvm::CombinerHelper::matchCastOfSelect(), llvm::CombinerHelper::matchCombineAddP2IToPtrAdd(), llvm::CombinerHelper::matchCombineAnyExtTrunc(), llvm::CombinerHelper::matchCombineConcatVectors(), llvm::CombinerHelper::matchCombineConstPtrAddToI2P(), llvm::CombinerHelper::matchCombineDivRem(), llvm::CombinerHelper::matchCombineExtendingLoads(), llvm::CombinerHelper::matchCombineExtractedVectorLoad(), llvm::CombinerHelper::matchCombineFAddFMAFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFAddFpExtFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFAddFpExtFMulToFMadOrFMAAggressive(), llvm::AMDGPUCombinerHelper::matchCombineFmulWithSelectToFldexp(), llvm::CombinerHelper::matchCombineFSubFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFSubFNegFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFSubFpExtFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFSubFpExtFNegFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineI2PToP2I(), llvm::CombinerHelper::matchCombineInsertVecElts(), llvm::CombinerHelper::matchCombineLoadWithAndMask(), llvm::CombinerHelper::matchCombineShiftToUnmerge(), llvm::CombinerHelper::matchCombineShlOfExtend(), llvm::CombinerHelper::matchCombineShuffleConcat(), llvm::CombinerHelper::matchCombineShuffleToBuildVector(), llvm::CombinerHelper::matchCombineShuffleVector(), llvm::CombinerHelper::matchCombineSubToAdd(), llvm::CombinerHelper::matchCombineTruncOfShift(), llvm::CombinerHelper::matchCombineUnmergeConstant(), llvm::CombinerHelper::matchCombineUnmergeMergeToPlainValues(), llvm::CombinerHelper::matchCombineUnmergeWithDeadLanesToTrunc(), llvm::CombinerHelper::matchCombineUnmergeZExtToZExt(), llvm::CombinerHelper::matchCombineZextTrunc(), llvm::CombinerHelper::matchCommuteShift(), llvm::CombinerHelper::matchConstantFoldCastOp(), llvm::CombinerHelper::matchConstantLargerBitWidth(), llvm::AMDGPUCombinerHelper::matchExpandPromotedF16FMed3(), llvm::CombinerHelper::matchExtendThroughPhis(), llvm::CombinerHelper::matchExtOfExt(), llvm::CombinerHelper::matchExtractAllEltsFromBuildVector(), llvm::CombinerHelper::matchExtractVecEltBuildVec(), llvm::CombinerHelper::matchExtractVectorElement(), llvm::CombinerHelper::matchExtractVectorElementWithBuildVector(), llvm::CombinerHelper::matchExtractVectorElementWithBuildVectorTrunc(), llvm::CombinerHelper::matchExtractVectorElementWithShuffleVector(), llvm::CombinerHelper::matchFoldAMinusC1MinusC2(), llvm::CombinerHelper::matchFoldAMinusC1PlusC2(), llvm::CombinerHelper::matchFoldAPlusC1MinusC2(), llvm::CombinerHelper::matchFoldC1Minus2MinusC2(), llvm::CombinerHelper::matchFoldC2MinusAPlusC1(), llvm::CombinerHelper::matchFreezeOfSingleMaybePoisonOperand(), llvm::CombinerHelper::matchFsubToFneg(), llvm::CombinerHelper::matchFunnelShiftToRotate(), llvm::CombinerHelper::matchHoistLogicOpWithSameOpcodeHands(), llvm::CombinerHelper::matchICmpToLHSKnownBits(), llvm::CombinerHelper::matchICmpToTrueFalseKnownBits(), llvm::CombinerHelper::matchInsertExtractVecEltOutOfBounds(), llvm::CombinerHelper::matchInsertVectorElementOOB(), llvm::CombinerHelper::matchLoadOrCombine(), llvm::CombinerHelper::matchMergeXAndUndef(), llvm::CombinerHelper::matchMergeXAndZero(), llvm::CombinerHelper::matchMulOBy0(), llvm::CombinerHelper::matchNarrowBinop(), llvm::CombinerHelper::matchNarrowBinopFeedingAnd(), llvm::CombinerHelper::matchNonNegZext(), llvm::CombinerHelper::matchNotCmp(), llvm::CombinerHelper::matchOrShiftToFunnelShift(), llvm::CombinerHelper::matchOverlappingAnd(), llvm::CombinerHelper::matchPtrAddImmedChain(), llvm::CombinerHelper::matchPtrAddZero(), llvm::CombinerHelper::matchReassocConstantInnerLHS(), llvm::CombinerHelper::matchReassocConstantInnerRHS(), llvm::CombinerHelper::matchReassocFoldConstantsInSubTree(), llvm::CombinerHelper::matchRedundantBinOpInEquality(), llvm::CombinerHelper::matchRedundantNegOperands(), llvm::CombinerHelper::matchRedundantSExtInReg(), llvm::CombinerHelper::matchRotateOutOfRange(), llvm::CombinerHelper::matchSDivOrSRemByConst(), llvm::CombinerHelper::matchSelectIMinMax(), llvm::CombinerHelper::matchSextInRegOfLoad(), llvm::CombinerHelper::matchSextOfTrunc(), llvm::CombinerHelper::matchSextTruncSextLoad(), llvm::CombinerHelper::matchShiftImmedChain(), llvm::CombinerHelper::matchShiftOfShiftedLogic(), llvm::CombinerHelper::matchShiftsTooBig(), llvm::CombinerHelper::matchShlOfVScale(), llvm::CombinerHelper::matchShuffleDisjointMask(), llvm::CombinerHelper::matchShuffleUndefRHS(), llvm::CombinerHelper::matchSimplifyNegMinMax(), llvm::CombinerHelper::matchSubAddSameReg(), llvm::CombinerHelper::matchSuboCarryOut(), llvm::CombinerHelper::matchSubOfVScale(), llvm::CombinerHelper::matchTruncateOfExt(), llvm::CombinerHelper::matchTruncBuildVectorFold(), llvm::CombinerHelper::matchTruncLshrBuildVectorFold(), llvm::CombinerHelper::matchTruncSSatS(), llvm::CombinerHelper::matchTruncSSatU(), llvm::CombinerHelper::matchTruncUSatU(), llvm::CombinerHelper::matchTruncUSatUToFPTOUISat(), llvm::CombinerHelper::matchUDivOrURemByConst(), llvm::CombinerHelper::matchUMulHToLShr(), llvm::CombinerHelper::matchUnmergeValuesAnyExtBuildVector(), llvm::CombinerHelper::matchUseVectorTruncate(), llvm::CombinerHelper::matchZextOfTrunc(), llvm::RegBankSelect::repairReg(), llvm::GISelValueTracking::signBitIsZero(), AMDGPURegBankLegalizeCombiner::tryCombineCopy(), AMDGPURegBankLegalizeCombiner::tryCombineS1AnyExt(), AMDGPURegBankLegalizeCombiner::tryEliminateReadAnyLane(), and llvm::CombinerHelper::tryReassocBinOp().
MachineInstr * MachineRegisterInfo::getUniqueVRegDef | ( | Register | Reg | ) | const |
getUniqueVRegDef - Return the unique machine instr that defines the specified virtual register or null if none is found.
If there are multiple definitions or no definition, return null.
Definition at line 419 of file MachineRegisterInfo.cpp.
References def_empty(), def_instr_begin(), def_instr_end(), and I.
Referenced by llvm::CombinerHelper::applyCombineIndexedLoadStore(), llvm::WebAssemblyRegisterInfo::eliminateFrameIndex(), genIndexedMultiply(), llvm::PeelingModuloScheduleExpander::getEquivalentRegisterIn(), llvm::PhiLoweringHelper::isConstantLaneMask(), llvm::CombinerHelper::matchFreezeOfSingleMaybePoisonOperand(), llvm::CombinerHelper::matchShiftImmedChain(), llvm::CombinerHelper::matchShiftOfShiftedLogic(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), llvm::PeelingModuloScheduleExpander::peelPrologAndEpilogs(), llvm::LiveVariables::recomputeForSingleDefVirtReg(), and llvm::PeelingModuloScheduleExpander::rewriteUsesOf().
Definition at line 914 of file MachineRegisterInfo.h.
Returns register class or bank and low level type of Reg
.
Always safe to use. Special values are returned when Reg
does not have some of the attributes.
Definition at line 753 of file MachineRegisterInfo.h.
References getRegClassOrRegBank(), getType(), and Reg.
Referenced by llvm::GISelInstProfileBuilder::addNodeIDReg(), llvm::MachineSSAUpdater::Initialize(), and llvm::PhiLoweringHelper::initializeLaneMaskRegisterAttributes().
MachineInstr * MachineRegisterInfo::getVRegDef | ( | Register | Reg | ) | const |
getVRegDef - Return the machine instr that defines the specified virtual register or null if none is found.
This assumes that the code is in SSA form, so there should only be one definition.
Definition at line 406 of file MachineRegisterInfo.cpp.
References assert(), def_instr_begin(), def_instr_end(), and I.
Referenced by llvm::Combiner::WorkListMaintainerImpl< Lvl >::appliedCombine(), llvm::CombinerHelper::applyCombineIndexedLoadStore(), llvm::CombinerHelper::applyCombineUnmergeZExtToZExt(), llvm::CombinerHelper::applyExtendThroughPhis(), llvm::CombinerHelper::applyFoldBinOpIntoSelect(), llvm::CombinerHelper::applyNotCmp(), llvm::CombinerHelper::applySextInRegOfLoad(), llvm::GISelValueTracking::computeKnownAlignment(), llvm::GISelValueTracking::computeKnownBitsImpl(), llvm::GISelValueTracking::computeNumSignBits(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), llvm::SPIRVIRMapping::findMI(), llvm::SPIRVGlobalRegistry::getOrCreateOpTypeSampledImage(), llvm::PeelingModuloScheduleExpander::getPhiCanonicalReg(), llvm::GISelValueTracking::getValidShiftAmountRange(), llvm::LiveVariables::HandleVirtRegUse(), llvm::CombinerHelper::matchAddOfVScale(), llvm::CombinerHelper::matchCombineConcatVectors(), llvm::CombinerHelper::matchCombineFAddFMAFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFAddFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFAddFpExtFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFAddFpExtFMulToFMadOrFMAAggressive(), llvm::AMDGPUCombinerHelper::matchCombineFmulWithSelectToFldexp(), llvm::CombinerHelper::matchCombineFSubFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineLoadWithAndMask(), llvm::CombinerHelper::matchCombineShlOfExtend(), llvm::CombinerHelper::matchCombineShuffleConcat(), llvm::CombinerHelper::matchCombineUnmergeConstant(), llvm::CombinerHelper::matchCombineUnmergeUndef(), llvm::CombinerHelper::matchCommuteConstantToRHS(), llvm::CombinerHelper::matchCommuteShift(), llvm::CombinerHelper::matchConstantOp(), llvm::CombinerHelper::matchConstantSelectCmp(), llvm::CombinerHelper::matchExtractVecEltBuildVec(), llvm::AMDGPUCombinerHelper::matchFoldableFneg(), llvm::CombinerHelper::matchFoldAMinusC1MinusC2(), llvm::CombinerHelper::matchFoldAMinusC1PlusC2(), llvm::CombinerHelper::matchFoldAPlusC1MinusC2(), llvm::CombinerHelper::matchFoldBinOpIntoSelect(), llvm::CombinerHelper::matchFoldC1Minus2MinusC2(), llvm::CombinerHelper::matchFoldC2MinusAPlusC1(), llvm::CombinerHelper::matchMulOfVScale(), llvm::CombinerHelper::matchNonNegZext(), llvm::CombinerHelper::matchNotCmp(), llvm::CombinerHelper::matchPtrAddImmedChain(), llvm::CombinerHelper::matchPtrAddZero(), llvm::CombinerHelper::matchReassocPtrAdd(), llvm::CombinerHelper::matchSDivOrSRemByConst(), llvm::CombinerHelper::matchSelectIMinMax(), llvm::CombinerHelper::matchShlOfVScale(), llvm::CombinerHelper::matchSimplifyNegMinMax(), llvm::CombinerHelper::matchSubOfVScale(), llvm::CombinerHelper::matchUDivOrURemByConst(), llvm::CombinerHelper::matchUnmergeValuesAnyExtBuildVector(), llvm::CombinerHelper::matchUseVectorTruncate(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::WindowScheduler::schedulePhi(), llvm::TailDuplicator::tailDuplicateAndUpdate(), AMDGPURegBankLegalizeCombiner::tryEliminateReadAnyLane(), AMDGPURegBankLegalizeCombiner::tryMatch(), AMDGPURegBankLegalizeCombiner::tryMatchRALFromUnmerge(), llvm::CombinerHelper::tryReassocBinOp(), validateFunCallMachineDef(), and llvm::SSAUpdaterTraits< MachineSSAUpdater >::ValueIsPHI().
Definition at line 432 of file MachineRegisterInfo.h.
References llvm::IndexedMap< T, ToIndexT >::inBounds(), and Reg.
hasAtMostUses - Return true if the given register has at most MaxUsers
non-debug user instructions.
Definition at line 440 of file MachineRegisterInfo.cpp.
References llvm::hasNItemsOrLess(), use_instr_nodbg_begin(), and use_instr_nodbg_end().
Return true if there is exactly one operand defining the specified register.
Definition at line 448 of file MachineRegisterInfo.h.
References def_operands(), and llvm::hasSingleElement().
Referenced by llvm::ScheduleDAGInstrs::addVRegDefDeps(), llvm::InstrEmitter::EmitDbgInstrRef(), and llvm::MachineFunction::finalizeDebugInstrRefs().
hasOneNonDBGUse - Return true if there is exactly one non-Debug use of the specified register.
Definition at line 427 of file MachineRegisterInfo.cpp.
References llvm::hasSingleElement(), and use_nodbg_operands().
Referenced by llvm::AMDGPUCombinerHelper::applyFoldableFneg(), llvm::CombinerHelper::matchAddOfVScale(), llvm::CombinerHelper::matchAddOverflow(), llvm::CombinerHelper::matchCastOfBuildVector(), llvm::CombinerHelper::matchCastOfSelect(), llvm::CombinerHelper::matchCombineConcatVectors(), llvm::CombinerHelper::matchCombineExtractedVectorLoad(), llvm::CombinerHelper::matchCombineFAddFMAFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFAddFMulToFMadOrFMA(), llvm::AMDGPUCombinerHelper::matchCombineFmulWithSelectToFldexp(), llvm::CombinerHelper::matchCombineFSubFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFSubFNegFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineFSubFpExtFMulToFMadOrFMA(), llvm::CombinerHelper::matchCombineLoadWithAndMask(), llvm::CombinerHelper::matchCombineTruncOfShift(), llvm::AMDGPUCombinerHelper::matchExpandPromotedF16FMed3(), llvm::CombinerHelper::matchExtendThroughPhis(), llvm::CombinerHelper::matchExtOfExt(), llvm::CombinerHelper::matchExtractVecEltBuildVec(), llvm::CombinerHelper::matchExtractVectorElementWithBuildVector(), llvm::CombinerHelper::matchExtractVectorElementWithBuildVectorTrunc(), llvm::AMDGPUCombinerHelper::matchFoldableFneg(), llvm::CombinerHelper::matchFoldAMinusC1MinusC2(), llvm::CombinerHelper::matchFoldAMinusC1PlusC2(), llvm::CombinerHelper::matchFoldAPlusC1MinusC2(), llvm::CombinerHelper::matchFoldBinOpIntoSelect(), llvm::CombinerHelper::matchFoldC1Minus2MinusC2(), llvm::CombinerHelper::matchFoldC2MinusAPlusC1(), llvm::CombinerHelper::matchFreezeOfSingleMaybePoisonOperand(), llvm::CombinerHelper::matchHoistLogicOpWithSameOpcodeHands(), llvm::CombinerHelper::matchMulOfVScale(), llvm::CombinerHelper::matchNarrowBinop(), llvm::CombinerHelper::matchNarrowBinopFeedingAnd(), llvm::CombinerHelper::matchNotCmp(), llvm::CombinerHelper::matchSelectIMinMax(), llvm::CombinerHelper::matchSextInRegOfLoad(), llvm::CombinerHelper::matchShiftOfShiftedLogic(), llvm::CombinerHelper::matchShlOfVScale(), llvm::CombinerHelper::matchSubOfVScale(), llvm::CombinerHelper::matchTruncateOfExt(), llvm::CombinerHelper::matchUnmergeValuesAnyExtBuildVector(), llvm::CombinerHelper::matchXorOfAndWithSameReg(), and llvm::TailDuplicator::tailDuplicateAndUpdate().
hasOneNonDBGUse - Return true if there is exactly one non-Debug instruction using the specified register.
Said instruction may have multiple uses.
Definition at line 431 of file MachineRegisterInfo.cpp.
References llvm::hasSingleElement(), and use_nodbg_instructions().
Referenced by llvm::Combiner::WorkListMaintainerImpl< Lvl >::appliedCombine().
hasOneUse - Return true if there is exactly one instruction using the specified register.
Definition at line 513 of file MachineRegisterInfo.h.
References llvm::hasSingleElement(), and use_operands().
Referenced by llvm::CombinerHelper::matchCombineInsertVecElts(), and llvm::FastISel::tryToFoldLoad().
Definition at line 436 of file MachineRegisterInfo.h.
References assert(), llvm::StringSet< AllocatorTy >::contains(), llvm::IndexedMap< T, ToIndexT >::grow(), llvm::StringSet< AllocatorTy >::insert(), Name, and Reg.
Referenced by createIncompleteVirtualRegister().
|
inline |
invalidateLiveness - Indicates that register liveness is no longer being tracked accurately.
This should be called by late passes that invalidate the liveness information.
Definition at line 218 of file MachineRegisterInfo.h.
References llvm::MachineFunction::getProperties().
Referenced by llvm::MIRParserImpl::parseRegisterInfo().
|
inline |
isAllocatable - Returns true when PhysReg belongs to an allocatable register class and it hasn't been reserved.
Allocatable registers may show up in the allocation order of some virtual register, so a register allocator needs to track its liveness and availability.
Definition at line 989 of file MachineRegisterInfo.h.
References getTargetRegisterInfo(), llvm::TargetRegisterInfo::isInAllocatableClass(), and isReserved().
Referenced by llvm::AggressiveAntiDepBreaker::BreakAntiDependencies(), llvm::CriticalAntiDepBreaker::BreakAntiDependencies(), llvm::PPCRegisterInfo::getCalleeSavedRegs(), and isConstantPhysReg().
bool MachineRegisterInfo::isConstantPhysReg | ( | MCRegister | PhysReg | ) | const |
Returns true if PhysReg is unallocatable and constant throughout the function.
Writing to a constant register has no effect.
Definition at line 532 of file MachineRegisterInfo.cpp.
References assert(), def_empty(), getTargetRegisterInfo(), isAllocatable(), llvm::MCRegister::isPhysical(), llvm::MCRegAliasIterator::isValid(), and TRI.
Referenced by llvm::ScheduleDAGInstrs::addPhysRegDeps(), and llvm::LiveRangeEdit::allUsesAvailableAt().
Definition at line 455 of file MachineRegisterInfo.cpp.
References liveins().
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::X86FrameLowering::adjustForSegmentedStacks(), llvm::ARMFrameLowering::determineCalleeSaves(), getPrologueDeath(), isSignExtendedW(), llvm::PPCInstrInfo::isSignOrZeroExtended(), llvm::Thumb1FrameLowering::spillCalleeSavedRegisters(), and llvm::M68kFrameLowering::spillCalleeSavedRegisters().
bool MachineRegisterInfo::isPhysRegModified | ( | MCRegister | PhysReg, |
bool | SkipNoReturnDef = false |
||
) | const |
Return true if the specified register is modified in this function.
This checks that no defining machine operands exist for the register or any of its aliases. Definitions found on functions marked noreturn are ignored, to consider them pass 'true' for optional parameter SkipNoReturnDef. The register is also considered modified when it is set in the UsedPhysRegMask.
Definition at line 589 of file MachineRegisterInfo.cpp.
References def_begin(), def_end(), getTargetRegisterInfo(), llvm::MCRegister::id(), isNoReturnDef(), llvm::MCRegAliasIterator::isValid(), llvm::make_range(), llvm::BitVector::test(), and TRI.
Referenced by llvm::SIFrameLowering::determineCalleeSaves().
bool MachineRegisterInfo::isPhysRegUsed | ( | MCRegister | PhysReg, |
bool | SkipRegMaskTest = false |
||
) | const |
Return true if the specified register is modified or read in this function.
This checks that no machine operands exist for the register or any of its aliases. If SkipRegMaskTest is false, the register is considered used when it is set in the UsedPhysRegMask.
Definition at line 604 of file MachineRegisterInfo.cpp.
References getTargetRegisterInfo(), llvm::MCRegister::id(), llvm::MCRegAliasIterator::isValid(), reg_nodbg_empty(), llvm::BitVector::test(), and TRI.
Referenced by llvm::AArch64FrameLowering::determineCalleeSaves(), and llvm::GCNHazardRecognizer::GCNHazardRecognizer().
|
inline |
isReserved - Returns true when PhysReg is a reserved register.
Reserved registers may belong to an allocatable register class, but the target has explicitly requested that they are not used.
Definition at line 971 of file MachineRegisterInfo.h.
References getReservedRegs(), llvm::MCRegister::id(), and llvm::BitVector::test().
Referenced by llvm::SIRegisterInfo::buildSpillLoadStore(), llvm::RegAllocBase::cleanupFailedVReg(), llvm::SIRegisterInfo::eliminateFrameIndex(), llvm::RISCVFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), indirectCopyToAGPR(), isAllocatable(), llvm::SIRegisterInfo::isAsmClobberable(), and toggleKills().
Returns true when the given register unit is considered reserved.
Register units are considered reserved when for at least one of their root registers, the root register and all super registers are reserved. This currently iterates the register hierarchy and may be slower than expected.
Definition at line 665 of file MachineRegisterInfo.cpp.
References llvm::all_of(), getTargetRegisterInfo(), llvm::MCRegUnitRootIterator::isValid(), and TRI.
|
inline |
Definition at line 202 of file MachineRegisterInfo.h.
References llvm::MachineFunction::getProperties().
Referenced by llvm::PPCInstrInfo::materializeImmPostRA().
|
inline |
Returns true if the updated CSR list was initialized and false otherwise.
Definition at line 239 of file MachineRegisterInfo.h.
|
inline |
Definition at line 205 of file MachineRegisterInfo.h.
References llvm::MachineFunction::getProperties().
|
inline |
Definition at line 1008 of file MachineRegisterInfo.h.
Referenced by llvm::MachineFunction::print().
|
inline |
Definition at line 1010 of file MachineRegisterInfo.h.
Referenced by llvm::MachineFunction::print().
|
inline |
Definition at line 1009 of file MachineRegisterInfo.h.
Referenced by llvm::MachineFunction::print().
|
inline |
Definition at line 1012 of file MachineRegisterInfo.h.
Referenced by llvm::X86AsmPrinter::emitKCFITypeId(), getLiveInPhysReg(), getLiveInVirtReg(), isLiveIn(), llvm::FastISel::lowerDbgValue(), processIfEntryValueDbgDeclare(), and llvm::SelectionDAGISel::runOnMachineFunction().
void MachineRegisterInfo::markUsesInDebugValueAsUndef | ( | Register | Reg | ) | const |
markUsesInDebugValueAsUndef - Mark every DBG_VALUE referencing the specified register as undefined which causes the DBG_VALUE to be deleted during LiveDebugVariables analysis.
Definition at line 551 of file MachineRegisterInfo.cpp.
References llvm::make_early_inc_range(), use_instructions(), and UseMI.
void MachineRegisterInfo::moveOperands | ( | MachineOperand * | Dst, |
MachineOperand * | Src, | ||
unsigned | NumOps | ||
) |
Move NumOps operands from Src to Dst, updating use-def lists as needed.
The Dst range is assumed to be uninitialized memory. (Or it may contain operands that won't be destroyed, which is OK because the MO destructor is trivial anyway).
The Src and Dst ranges may overlap.
Definition at line 341 of file MachineRegisterInfo.cpp.
References assert().
|
inline |
Definition at line 184 of file MachineRegisterInfo.h.
Referenced by cloneVirtualRegister().
|
inline |
Definition at line 179 of file MachineRegisterInfo.h.
References Reg.
Referenced by createGenericVirtualRegister(), createVirtualRegister(), and llvm::MIRParserImpl::parseRegisterInfo().
|
delete |
recomputeRegClass - Try to find a legal super-class of Reg's register class that still satisfies the constraints from the instructions using Reg.
Returns true if Reg was upgraded.
This method can be used after constraints have been removed from a virtual register, for example after removing instructions or splitting the live range.
Definition at line 122 of file MachineRegisterInfo.cpp.
References llvm::TargetSubtargetInfo::getInstrInfo(), getRegClass(), llvm::MachineFunction::getSubtarget(), getTargetRegisterInfo(), MI, reg_nodbg_operands(), setRegClass(), TII, and TRI.
Referenced by llvm::LiveRangeEdit::calculateRegClassAndHint().
|
inline |
Definition at line 286 of file MachineRegisterInfo.h.
Referenced by reg_empty(), reg_operands(), and llvm::FastISel::tryToFoldLoad().
|
inline |
Definition at line 315 of file MachineRegisterInfo.h.
Referenced by reg_bundles().
|
inlinestatic |
Definition at line 318 of file MachineRegisterInfo.h.
Referenced by reg_bundles().
|
inline |
Definition at line 368 of file MachineRegisterInfo.h.
Referenced by reg_nodbg_bundles().
|
inlinestatic |
Definition at line 371 of file MachineRegisterInfo.h.
Referenced by reg_nodbg_bundles().
|
inline |
Definition at line 322 of file MachineRegisterInfo.h.
References llvm::make_range(), Reg, reg_bundle_begin(), and reg_bundle_end().
reg_empty - Return true if there are no instructions using or defining the specified register (it may be live-in).
Definition at line 328 of file MachineRegisterInfo.h.
References reg_begin(), and reg_end().
|
inlinestatic |
Definition at line 289 of file MachineRegisterInfo.h.
Referenced by reg_empty(), and reg_operands().
|
inline |
Definition at line 299 of file MachineRegisterInfo.h.
Referenced by reg_instructions().
|
inlinestatic |
Definition at line 302 of file MachineRegisterInfo.h.
Referenced by reg_instructions().
|
inline |
Definition at line 351 of file MachineRegisterInfo.h.
Referenced by reg_nodbg_instructions().
|
inlinestatic |
Definition at line 354 of file MachineRegisterInfo.h.
Referenced by reg_nodbg_instructions().
|
inline |
Definition at line 307 of file MachineRegisterInfo.h.
References llvm::make_range(), Reg, reg_instr_begin(), and reg_instr_end().
Referenced by llvm::RegAllocBase::allocatePhysRegs(), clearVirtRegs(), and llvm::LiveIntervals::shrinkToUses().
|
inline |
Definition at line 334 of file MachineRegisterInfo.h.
Referenced by reg_nodbg_empty(), and reg_nodbg_operands().
|
inline |
Definition at line 376 of file MachineRegisterInfo.h.
References llvm::make_range(), Reg, reg_bundle_nodbg_begin(), and reg_bundle_nodbg_end().
reg_nodbg_empty - Return true if the only instructions using or defining Reg are Debug instructions.
Definition at line 382 of file MachineRegisterInfo.h.
References reg_nodbg_begin(), and reg_nodbg_end().
Referenced by llvm::LiveIntervals::addKillFlags(), llvm::RegAllocBase::allocatePhysRegs(), and isPhysRegUsed().
|
inlinestatic |
Definition at line 337 of file MachineRegisterInfo.h.
Referenced by reg_nodbg_empty(), and reg_nodbg_operands().
|
inline |
Definition at line 359 of file MachineRegisterInfo.h.
References llvm::make_range(), Reg, reg_instr_nodbg_begin(), and reg_instr_nodbg_end().
|
inline |
Definition at line 342 of file MachineRegisterInfo.h.
References llvm::make_range(), Reg, reg_nodbg_begin(), and reg_nodbg_end().
Referenced by recomputeRegClass().
|
inline |
Definition at line 291 of file MachineRegisterInfo.h.
References llvm::make_range(), Reg, reg_begin(), and reg_end().
Referenced by llvm::RegAllocBase::cleanupFailedVReg(), replaceRegWith(), and verifyUseList().
void MachineRegisterInfo::removeRegOperandFromUseList | ( | MachineOperand * | MO | ) |
Remove MO from its use-def list.
Definition at line 312 of file MachineRegisterInfo.cpp.
References assert(), and llvm::MachineOperand::getReg().
Referenced by llvm::MachineOperand::ChangeToRegister().
replaceRegWith - Replace all instances of FromReg with ToReg in the machine function.
This is like llvm-level X->replaceAllUsesWith(Y), except that it also changes any definitions of the register as well.
Note that it is usually necessary to first constrain ToReg's register class and register bank to match the FromReg constraints using one of the methods:
constrainRegClass(ToReg, getRegClass(FromReg)) constrainRegAttrs(ToReg, FromReg) RegisterBankInfo::constrainGenericRegister(ToReg, *MRI.getRegClass(FromReg), MRI)
These functions will return a falsy result if the virtual registers have incompatible constraints.
Note that if ToReg is a physical register the function will replace and apply sub registers to ToReg in order to obtain a final/proper physical register.
This is like llvm-level X->replaceAllUsesWith(Y), except that it also changes any definitions of the register as well. If ToReg is a physical register we apply the sub register to obtain the final/proper physical register.
Definition at line 388 of file MachineRegisterInfo.cpp.
References assert(), getTargetRegisterInfo(), llvm::Register::isPhysical(), llvm::make_early_inc_range(), reg_operands(), and TRI.
Referenced by llvm::RegAllocBase::cleanupFailedVReg(), llvm::CombinerHelper::matchRedundantSextInReg(), llvm::PeelingModuloScheduleExpander::moveStageBetweenBlocks(), llvm::CombinerHelper::replaceRegWith(), AMDGPURegBankLegalizeCombiner::replaceRegWithOrBuildCopy(), llvm::PeelingModuloScheduleExpander::rewriteUsesOf(), llvm::TailDuplicator::tailDuplicateAndUpdate(), and AMDGPURegBankLegalizeCombiner::tryCombineS1AnyExt().
|
inline |
reservedRegsFrozen - Returns true after freezeReservedRegs() was called to ensure the set of reserved registers stays constant.
Definition at line 946 of file MachineRegisterInfo.h.
Referenced by canReserveReg(), getReservedRegs(), llvm::AArch64InstrInfo::probedStackAlloc(), and reserveReg().
|
inline |
reserveReg – Mark a register as reserved so checks like isAllocatable will not suggest using it.
This should not be used during the middle of a function walk, or when liveness info is available.
Definition at line 935 of file MachineRegisterInfo.h.
References assert(), reservedRegsFrozen(), and TRI.
|
inline |
Definition at line 163 of file MachineRegisterInfo.h.
References assert(), llvm::SmallPtrSetImpl< PtrType >::count(), and llvm::SmallPtrSetImpl< PtrType >::erase().
Sets the updated Callee Saved Registers list.
Notice that it will override ant previously disabled/saved CSRs.
Definition at line 653 of file MachineRegisterInfo.cpp.
References llvm::append_range().
Referenced by llvm::MIRParserImpl::parseRegisterInfo(), and llvm::AArch64RegisterInfo::UpdateCustomCalleeSavedRegs().
|
inline |
setRegAllocationHint - Specify a register allocation hint for the specified virtual register.
This is typically used by target, and in case of an earlier hint it will be overwritten.
Definition at line 801 of file MachineRegisterInfo.h.
References assert(), getNumVirtRegs(), llvm::IndexedMap< T, ToIndexT >::grow(), llvm::Register::index2VirtReg(), and llvm::Register::isVirtual().
Referenced by setSimpleHint().
void MachineRegisterInfo::setRegBank | ( | Register | Reg, |
const RegisterBank & | RegBank | ||
) |
Set the register bank to RegBank
for Reg
.
Definition at line 63 of file MachineRegisterInfo.cpp.
Referenced by llvm::RegBankSelect::applyMapping(), llvm::RegBankSelect::assignInstr(), and llvm::CombinerHelper::setRegBank().
void MachineRegisterInfo::setRegClass | ( | Register | Reg, |
const TargetRegisterClass * | RC | ||
) |
setRegClass - Set the register class of the specified virtual register.
Definition at line 58 of file MachineRegisterInfo.cpp.
References assert(), and llvm::TargetRegisterClass::isAllocatable().
Referenced by llvm::buildBoolRegister(), llvm::SPIRVGlobalRegistry::createConstFP(), llvm::SPIRVGlobalRegistry::createConstInt(), llvm::generateImageSizeQueryInst(), llvm::SPIRVGlobalRegistry::getOrCreateConstNullPtr(), llvm::SPIRVGlobalRegistry::getOrCreateUndef(), recomputeRegClass(), and llvm::PeelingModuloScheduleExpander::rewriteUsesOf().
|
inline |
Definition at line 695 of file MachineRegisterInfo.h.
References Reg.
Referenced by llvm::CombinerHelper::applyCombineUnmergeMergeToPlainValues(), and constrainRegAttrs().
Specify the preferred (target independent) register allocation hint for the specified virtual register.
Definition at line 820 of file MachineRegisterInfo.h.
References setRegAllocationHint().
Set the low-level type of VReg
to Ty
.
Definition at line 187 of file MachineRegisterInfo.cpp.
References llvm::IndexedMap< T, ToIndexT >::grow().
Referenced by allocateVGPR32Input(), llvm::buildBuiltinVariableLoad(), cloneVirtualRegister(), constrainRegAttrs(), createGenericVirtualRegister(), and createVirtualRegister().
|
inline |
Returns true if liveness for register class RC
should be tracked at the subregister level.
Definition at line 222 of file MachineRegisterInfo.h.
References llvm::TargetRegisterClass::HasDisjunctSubRegs, and subRegLivenessEnabled().
Referenced by shouldTrackSubRegLiveness().
Definition at line 225 of file MachineRegisterInfo.h.
References assert(), getRegClassOrNull(), llvm::Register::isVirtual(), LLVM_LIKELY, and shouldTrackSubRegLiveness().
|
inline |
Definition at line 230 of file MachineRegisterInfo.h.
Referenced by llvm::LiveIntervals::addKillFlags(), and shouldTrackSubRegLiveness().
|
inline |
tracksLiveness - Returns true when tracking register liveness accurately.
(see MachineFUnctionProperties::Property description for details)
Definition at line 209 of file MachineRegisterInfo.h.
References llvm::MachineFunction::getProperties().
Referenced by findRenameRegForSameLdStRegPair(), llvm::AArch64InstrInfo::getOutlinableRanges(), llvm::ARMBaseInstrInfo::isMBBSafeToOutlineFrom(), and llvm::MIRParserImpl::parseRegisterInfo().
|
inline |
updateDbgUsersToReg - Update a collection of debug instructions to refer to the designated register.
Definition at line 866 of file MachineRegisterInfo.h.
References assert(), getTargetRegisterInfo(), llvm_unreachable, MI, llvm::TargetRegisterInfo::regsOverlap(), and Users.
|
inline |
Definition at line 467 of file MachineRegisterInfo.h.
Referenced by use_empty(), and use_operands().
|
inline |
Definition at line 496 of file MachineRegisterInfo.h.
Referenced by use_bundles().
|
inlinestatic |
Definition at line 499 of file MachineRegisterInfo.h.
Referenced by use_bundles().
|
inline |
Definition at line 555 of file MachineRegisterInfo.h.
Referenced by use_nodbg_bundles().
|
inlinestatic |
Definition at line 558 of file MachineRegisterInfo.h.
Referenced by use_nodbg_bundles().
|
inline |
Definition at line 503 of file MachineRegisterInfo.h.
References llvm::make_range(), Reg, use_bundle_begin(), and use_bundle_end().
use_empty - Return true if there are no instructions using the specified register.
Definition at line 509 of file MachineRegisterInfo.h.
References use_begin(), and use_end().
Referenced by llvm::NVPTXFrameLowering::emitPrologue(), and GetInitialOffset().
|
inlinestatic |
Definition at line 470 of file MachineRegisterInfo.h.
Referenced by use_empty(), and use_operands().
|
inline |
Definition at line 480 of file MachineRegisterInfo.h.
Referenced by llvm::CombinerHelper::matchCombineInsertVecElts(), and use_instructions().
|
inlinestatic |
Definition at line 483 of file MachineRegisterInfo.h.
Referenced by use_instructions().
|
inline |
Definition at line 538 of file MachineRegisterInfo.h.
Referenced by llvm::Combiner::WorkListMaintainerImpl< Lvl >::appliedCombine(), hasAtMostUserInstrs(), llvm::CombinerHelper::matchExtendThroughPhis(), and use_nodbg_instructions().
|
inlinestatic |
Definition at line 541 of file MachineRegisterInfo.h.
Referenced by hasAtMostUserInstrs(), and use_nodbg_instructions().
|
inline |
Definition at line 488 of file MachineRegisterInfo.h.
References llvm::make_range(), Reg, use_instr_begin(), and use_instr_end().
Referenced by llvm::PeelingModuloScheduleExpander::CreateLCSSAExitingBlock(), dumpUses(), llvm::PeelingModuloScheduleExpander::filterInstructions(), llvm::PhiLoweringHelper::lowerPhis(), markUsesInDebugValueAsUndef(), llvm::CombinerHelper::matchCombineTruncOfShift(), llvm::PeelingModuloScheduleExpander::rewriteUsesOf(), and llvm::SelectionDAGISel::runOnMachineFunction().
|
inline |
Definition at line 521 of file MachineRegisterInfo.h.
Referenced by use_nodbg_empty(), and use_nodbg_operands().
|
inline |
Definition at line 563 of file MachineRegisterInfo.h.
References llvm::make_range(), Reg, use_bundle_nodbg_begin(), and use_bundle_nodbg_end().
use_nodbg_empty - Return true if there are no non-Debug instructions using the specified register.
Definition at line 569 of file MachineRegisterInfo.h.
References use_nodbg_begin(), and use_nodbg_end().
Referenced by EmitLiveInCopies(), llvm::CombinerHelper::matchAddOverflow(), and llvm::CombinerHelper::matchCombineUnmergeWithDeadLanesToTrunc().
|
inlinestatic |
Definition at line 524 of file MachineRegisterInfo.h.
Referenced by use_nodbg_empty(), and use_nodbg_operands().
|
inline |
Definition at line 546 of file MachineRegisterInfo.h.
References llvm::make_range(), Reg, use_instr_nodbg_begin(), and use_instr_nodbg_end().
Referenced by llvm::Combiner::WorkListMaintainerImpl< Lvl >::addUsersToWorkList(), getOneNonDBGUser(), hasOneNonDBGUser(), llvm::CombinerHelper::matchCombineDivRem(), llvm::CombinerHelper::matchCombineExtendingLoads(), llvm::CombinerHelper::matchExtractAllEltsFromBuildVector(), and llvm::CombinerHelper::matchPtrAddImmedChain().
|
inline |
Definition at line 529 of file MachineRegisterInfo.h.
References llvm::make_range(), Reg, use_nodbg_begin(), and use_nodbg_end().
Referenced by hasOneNonDBGUse(), llvm::LiveVariables::recomputeForSingleDefVirtReg(), and llvm::LiveIntervals::shrinkToUses().
|
inline |
Definition at line 472 of file MachineRegisterInfo.h.
References llvm::make_range(), Reg, use_begin(), and use_end().
Referenced by llvm::CombinerHelper::applyCombineExtendingLoads(), clearKillFlags(), llvm::ModuloScheduleExpander::expand(), hasOneUse(), and llvm::TailDuplicator::tailDuplicateAndUpdate().
void MachineRegisterInfo::verifyUseList | ( | Register | Reg | ) | const |
Verify the sanity of the use list for Reg.
Definition at line 225 of file MachineRegisterInfo.cpp.
References assert(), llvm::errs(), llvm::MachineOperand::getParent(), llvm::MachineOperand::getReg(), getTargetRegisterInfo(), llvm::MachineOperand::isReg(), MI, llvm::printReg(), and reg_operands().
Referenced by clearVirtRegs(), and verifyUseLists().
void MachineRegisterInfo::verifyUseLists | ( | ) | const |
Verify the use list of all registers.
Definition at line 263 of file MachineRegisterInfo.cpp.
References getNumVirtRegs(), getTargetRegisterInfo(), llvm::Register::index2VirtReg(), and verifyUseList().
|
friend |
Definition at line 281 of file MachineRegisterInfo.h.
Definition at line 280 of file MachineRegisterInfo.h.