class MemoryPhi

Declaration

class MemoryPhi : public MemoryAccess { /* full declaration omitted */ };

Description

Represents phi nodes for memory accesses. These have the same semantic as regular phi nodes, with the exception that only one phi will ever exist in a given basic block. Guaranteeing one phi per block means guaranteeing there is only ever one valid reaching MemoryDef/MemoryPHI along each path to the phi node. This is ensured by not allowing disambiguation of the RHS of a MemoryDef or a MemoryPhi's operands. That is, given if (a) { store %a store %b } it *must* be transformed into if (a) { 1 = MemoryDef(liveOnEntry) store %a 2 = MemoryDef(1) store %b } and *not* if (a) { 1 = MemoryDef(liveOnEntry) store %a 2 = MemoryDef(liveOnEntry) store %b } even if the two stores do not conflict. Otherwise, both 1 and 2 reach the end of the branch, and if there are not two phi nodes, one will be disconnected completely from the SSA graph below that point. Because MemoryUse's do not generate new definitions, they do not have this issue.

Declared at: llvm/include/llvm/Analysis/MemorySSA.h:493

Inherits from: MemoryAccess

Member Variables

private const unsigned int ID
private unsigned int ReservedSpace

Inherited from Value:

protected SubclassOptionalData
protected NumUserOperands
protected IsUsedByMD
protected HasName
protected HasMetadata
protected HasHungOffUses
protected HasDescriptor
public static MaxAlignmentExponent = 32
public static MaximumAlignment = 1ULL << MaxAlignmentExponent

Method Overview

Inherited from MemoryAccess:

Inherited from DerivedUser:

    Inherited from User:

    Inherited from Value:

    Methods

    MemoryPhi(llvm::LLVMContext& C,
              llvm::BasicBlock* BB,
              unsigned int Ver,
              unsigned int NumPreds = 0)

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:503

    Parameters

    llvm::LLVMContext& C
    llvm::BasicBlock* BB
    unsigned int Ver
    unsigned int NumPreds = 0

    void addIncoming(llvm::MemoryAccess* V,
                     llvm::BasicBlock* BB)

    Description

    Add an incoming value to the end of the PHI list

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:575

    Parameters

    llvm::MemoryAccess* V
    llvm::BasicBlock* BB

    void allocHungoffUses(unsigned int N)

    Description

    this is more complicated than the generic User::allocHungoffUses, because we have to allocate Uses for the incoming values and pointers to the incoming blocks, all in one allocation.

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:654

    Parameters

    unsigned int N

    llvm::MemoryPhi::block_iterator block_begin()

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:514

    llvm::MemoryPhi::const_block_iterator
    block_begin() const

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:518

    llvm::MemoryPhi::block_iterator block_end()

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:522

    llvm::MemoryPhi::const_block_iterator block_end()
        const

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:524

    iterator_range<llvm::MemoryPhi::block_iterator>
    blocks()

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:528

    iterator_range<
        llvm::MemoryPhi::const_block_iterator>
    blocks() const

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:532

    static bool classof(const llvm::Value* V)

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:640

    Parameters

    const llvm::Value* V

    static void deleteMe(llvm::DerivedUser* Self)

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:672

    Parameters

    llvm::DerivedUser* Self

    int getBasicBlockIndex(
        const llvm::BasicBlock* BB) const

    Description

    Return the first index of the specified basic block in the value list for this PHI. Returns -1 if no instance.

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:586

    Parameters

    const llvm::BasicBlock* BB

    unsigned int getID() const

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:646

    llvm::BasicBlock* getIncomingBlock(
        const llvm::Use& U) const

    Description

    Return incoming basic block corresponding to an operand of the PHI.

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:558

    Parameters

    const llvm::Use& U

    llvm::BasicBlock* getIncomingBlock(
        MemoryAccess::const_user_iterator I) const

    Description

    Return incoming basic block corresponding to value use iterator.

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:565

    Parameters

    MemoryAccess::const_user_iterator I

    llvm::BasicBlock* getIncomingBlock(
        unsigned int I) const

    Description

    Return incoming basic block number @p i.

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:554

    Parameters

    unsigned int I

    llvm::MemoryAccess* getIncomingValue(
        unsigned int I) const

    Description

    Return incoming value number x

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:544

    Parameters

    unsigned int I

    llvm::MemoryAccess* getIncomingValueForBlock(
        const llvm::BasicBlock* BB) const

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:593

    Parameters

    const llvm::BasicBlock* BB

    static unsigned int getIncomingValueNumForOperand(
        unsigned int I)

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:551

    Parameters

    unsigned int I

    unsigned int getNumIncomingValues() const

    Description

    Return the number of incoming edges

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:541

    static unsigned int getOperandNumForIncomingValue(
        unsigned int I)

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:550

    Parameters

    unsigned int I

    void growOperands()

    Description

    This grows the operand list in response to a push_back style of operation. This grows the number of ops by 1.5 times.

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:665

    llvm::User::const_op_range incoming_values() const

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:538

    llvm::User::op_range incoming_values()

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:536

    void print(llvm::raw_ostream& OS) const

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:644

    Parameters

    llvm::raw_ostream& OS

    void setIncomingBlock(unsigned int I,
                          llvm::BasicBlock* BB)

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:569

    Parameters

    unsigned int I
    llvm::BasicBlock* BB

    void setIncomingValue(unsigned int I,
                          llvm::MemoryAccess* V)

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:545

    Parameters

    unsigned int I
    llvm::MemoryAccess* V

    void unorderedDeleteIncoming(unsigned int I)

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:600

    Parameters

    unsigned int I

    void unorderedDeleteIncomingBlock(
        const llvm::BasicBlock* BB)

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:628

    Parameters

    const llvm::BasicBlock* BB

    template <typename Fn>
    void unorderedDeleteIncomingIf(Fn&& Pred)

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:616

    Templates

    Fn

    Parameters

    Fn&& Pred

    void unorderedDeleteIncomingValue(
        const llvm::MemoryAccess* MA)

    Declared at: llvm/include/llvm/Analysis/MemorySSA.h:635

    Parameters

    const llvm::MemoryAccess* MA