llvm::GenericSSAContext

Thin IR-agnostic context for SSA analyses over LLVM IR or Machine IR.

Synopsis

Declared in <llvm/ADT/GenericSSAContext.h>

template<typename _FunctionT>
class GenericSSAContext;

Description

Ideally this should have been a stateless traits class. But the print methods for Machine IR need access to the owning function. So we track that state in the template itself.

We use FunctionT as a template argument and not GenericSSATraits to allow forward declarations using well-known typenames.

Type Aliases

NameDescription
BlockT Basic-block type: a sequence of instructions and a CFG node.
ConstValueRefT Const SSA value reference (const binds to the pointee, not the pointer).
DominatorTreeT Dominator tree over this IR's basic blocks.
FunctionT Function type: a CFG with arguments and return values.
InstructionT Instruction type that defines one or more SSA values.
UseT Use edge from a defining instruction to a using instruction.
ValueRefT Handle to an SSA value (pointer-like; Machine IR has no Value object).

Member Functions

NameDescription
GenericSSAContext [constructor]Constructors
getDefBlock Return the basic block that defines value, or null if none.
getFunction Return the function this context is bound to, or null.
print print overloads
printAsOperand Return a printable operand form of basic block BB.

Static Member Functions

NameDescription
appendBlockDefs appendBlockDefs overloads
appendBlockTerms appendBlockTerms overloads
getIntrinsicID Return the intrinsic ID for instruction I, if it is an intrinsic.
isAlwaysUniform Return true if V is always uniform.
isConstantOrUndefValuePhi Return true if Instr is a phi of only constant or undef values.

Static Data Members

NameDescription
ValueRefNull Null value reference for this IR (default-constructed ValueRefT).