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:482

Inherits from: MemoryAccess

Member Variables

Inherited from Value:

protected SubclassOptionalData
protected NumUserOperands
protected IsUsedByMD
protected HasName
protected HasHungOffUses
protected HasDescriptor
public static MaxAlignmentExponent = 29
public static MaximumAlignment = 1U << 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:490

    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:565

    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:644

    Parameters

    unsigned int N

    llvm::MemoryPhi::block_iterator block_begin()

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

    llvm::MemoryPhi::const_block_iterator
    block_begin() const

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

    llvm::MemoryPhi::block_iterator block_end()

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

    llvm::MemoryPhi::const_block_iterator block_end()
        const

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

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

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

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

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

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

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

    Parameters

    const llvm::Value* V

    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:576

    Parameters

    const llvm::BasicBlock* BB

    unsigned int getID() const

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

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

    Description

    Return incoming basic block number @p i.

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

    Parameters

    unsigned int I

    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:555

    Parameters

    MemoryAccess::const_user_iterator I

    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:548

    Parameters

    const llvm::Use& U

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

    Description

    Return incoming value number x

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

    Parameters

    unsigned int I

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

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

    Parameters

    const llvm::BasicBlock* BB

    static unsigned int getIncomingValueNumForOperand(
        unsigned int I)

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

    Parameters

    unsigned int I

    unsigned int getNumIncomingValues() const

    Description

    Return the number of incoming edges

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

    static unsigned int getOperandNumForIncomingValue(
        unsigned int I)

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

    Parameters

    unsigned int I

    llvm::User::const_op_range incoming_values() const

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

    llvm::User::op_range incoming_values()

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

    void print(llvm::raw_ostream& OS) const

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

    Parameters

    llvm::raw_ostream& OS

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

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

    Parameters

    unsigned int I
    llvm::BasicBlock* BB

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

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

    Parameters

    unsigned int I
    llvm::MemoryAccess* V

    void unorderedDeleteIncoming(unsigned int I)

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

    Parameters

    unsigned int I

    void unorderedDeleteIncomingBlock(
        const llvm::BasicBlock* BB)

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

    Parameters

    const llvm::BasicBlock* BB

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

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

    Templates

    Fn

    Parameters

    Fn&& Pred

    void unorderedDeleteIncomingValue(
        const llvm::MemoryAccess* MA)

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

    Parameters

    const llvm::MemoryAccess* MA