class MachineSSAUpdater

Declaration

class MachineSSAUpdater { /* full declaration omitted */ };

Description

MachineSSAUpdater - This class updates SSA form for a set of virtual registers defined in multiple blocks. This is used when code duplication or another unstructured transformation wants to rewrite a set of uses of one vreg with uses of a set of vregs.

Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:34

Member Variables

private void* AV = nullptr
private const llvm::TargetRegisterClass* VRC
VRC - Register class of the current virtual register.
private SmallVectorImpl<llvm::MachineInstr*>* InsertedPHIs
InsertedPHIs - If this is non-null, the MachineSSAUpdater adds all PHI nodes that it creates to the vector.
private const llvm::TargetInstrInfo* TII
private llvm::MachineRegisterInfo* MRI

Method Overview

Methods

void AddAvailableValue(
    llvm::MachineBasicBlock* BB,
    llvm::Register V)

Description

AddAvailableValue - Indicate that a rewritten value is available at the end of the specified block with the specified value.

Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:69

Parameters

llvm::MachineBasicBlock* BB
llvm::Register V

llvm::Register GetValueAtEndOfBlock(
    llvm::MachineBasicBlock* BB)

Description

GetValueAtEndOfBlock - Construct SSA form, materializing a value that is live at the end of the specified block.

Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:77

Parameters

llvm::MachineBasicBlock* BB

llvm::Register GetValueAtEndOfBlockInternal(
    llvm::MachineBasicBlock* BB,
    bool ExistingValueOnly = false)

Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:112

Parameters

llvm::MachineBasicBlock* BB
bool ExistingValueOnly = false

llvm::Register GetValueInMiddleOfBlock(
    llvm::MachineBasicBlock* BB,
    bool ExistingValueOnly = false)

Description

GetValueInMiddleOfBlock - Construct SSA form, materializing a value that is live in the middle of the specified block. If ExistingValueOnly is true then this will only return an existing value or $noreg; otherwise new instructions may be inserted to materialize a value. GetValueInMiddleOfBlock is the same as GetValueAtEndOfBlock except in one important case: if there is a definition of the rewritten value after the 'use' in BB. Consider code like this: X1 = ... SomeBB: use(X) X2 = ... br Cond, SomeBB, OutBB In this case, there are two values (X1 and X2) added to the AvailableVals set by the client of the rewriter, and those values are both live out of their respective blocks. However, the use of X happens in the *middle* of a block. Because of this, we need to insert a new PHI node in SomeBB to merge the appropriate values, and this value isn't live out of the block.

Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:99

Parameters

llvm::MachineBasicBlock* BB
bool ExistingValueOnly = false

bool HasValueForBlock(
    llvm::MachineBasicBlock* BB) const

Description

HasValueForBlock - Return true if the MachineSSAUpdater already has a value for the specified block.

Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:73

Parameters

llvm::MachineBasicBlock* BB

void Initialize(llvm::Register V)

Description

Initialize - Reset this object to get ready for a new set of SSA updates.

Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:64

Parameters

llvm::Register V

void Initialize(
    const llvm::TargetRegisterClass* RC)

Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:65

Parameters

const llvm::TargetRegisterClass* RC

MachineSSAUpdater(
    llvm::MachineFunction& MF,
    SmallVectorImpl<llvm::MachineInstr*>* NewPHI =
        nullptr)

Description

MachineSSAUpdater constructor. If InsertedPHIs is specified, it will be filled in with all PHI Nodes created by rewriting.

Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:56

Parameters

llvm::MachineFunction& MF
SmallVectorImpl<llvm::MachineInstr*>* NewPHI = nullptr

MachineSSAUpdater(const llvm::MachineSSAUpdater&)

Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:58

Parameters

const llvm::MachineSSAUpdater&

void RewriteUse(llvm::MachineOperand& U)

Description

RewriteUse - Rewrite a use of the symbolic value. This handles PHI nodes, which use their value in the corresponding predecessor. Note that this will not work if the use is supposed to be rewritten to a value defined in the same block as the use, but above it. Any 'AddAvailableValue's added for the use's block will be considered to be below it.

Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:107

Parameters

llvm::MachineOperand& U

~MachineSSAUpdater()

Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:60