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:32
Method Overview
- public void AddAvailableValue(llvm::MachineBasicBlock * BB, unsigned int V)
- public unsigned int GetValueAtEndOfBlock(llvm::MachineBasicBlock * BB)
- public unsigned int GetValueInMiddleOfBlock(llvm::MachineBasicBlock * BB)
- public bool HasValueForBlock(llvm::MachineBasicBlock * BB) const
- public void Initialize(unsigned int V)
- public MachineSSAUpdater(llvm::MachineFunction & MF, SmallVectorImpl<llvm::MachineInstr *> * NewPHI = nullptr)
- public MachineSSAUpdater(const llvm::MachineSSAUpdater &)
- public void RewriteUse(llvm::MachineOperand & U)
- public ~MachineSSAUpdater()
Methods
¶void AddAvailableValue(
llvm::MachineBasicBlock* BB,
unsigned int V)
void AddAvailableValue(
llvm::MachineBasicBlock* BB,
unsigned int 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
- unsigned int V
¶unsigned int GetValueAtEndOfBlock(
llvm::MachineBasicBlock* BB)
unsigned int 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
¶unsigned int GetValueInMiddleOfBlock(
llvm::MachineBasicBlock* BB)
unsigned int GetValueInMiddleOfBlock(
llvm::MachineBasicBlock* BB)
Description
GetValueInMiddleOfBlock - Construct SSA form, materializing a value that is live in the middle of the specified block. 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:97
Parameters
¶bool HasValueForBlock(
llvm::MachineBasicBlock* BB) const
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
¶void Initialize(unsigned int V)
void Initialize(unsigned int V)
Description
Initialize - Reset this object to get ready for a new set of SSA updates.
Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:65
Parameters
- unsigned int V
¶MachineSSAUpdater(
llvm::MachineFunction& MF,
SmallVectorImpl<llvm::MachineInstr*>* NewPHI =
nullptr)
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:57
Parameters
- llvm::MachineFunction& MF
- SmallVectorImpl<llvm::MachineInstr*>* NewPHI = nullptr
¶MachineSSAUpdater(const llvm::MachineSSAUpdater&)
MachineSSAUpdater(const llvm::MachineSSAUpdater&)
Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:59
Parameters
- const llvm::MachineSSAUpdater&
¶void RewriteUse(llvm::MachineOperand& U)
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:104
Parameters
¶~MachineSSAUpdater()
~MachineSSAUpdater()
Declared at: llvm/include/llvm/CodeGen/MachineSSAUpdater.h:61