struct AAMemoryLocation

Declaration

struct AAMemoryLocation : public IRAttribute { /* full declaration omitted */ };

Description

An abstract interface for all memory location attributes (readnone/argmemonly/inaccessiblememonly/inaccessibleorargmemonly).

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4117

Inherits from: IRAttribute

Member Variables

public static const char ID
Unique ID (due to the unique address)

Method Overview

Methods

AAMemoryLocation(const llvm::IRPosition& IRP,
                 llvm::Attributor& A)

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4123

Parameters

const llvm::IRPosition& IRP
llvm::Attributor& A

virtual bool checkForAllAccessesToMemoryKind(
    function_ref<
        bool(const llvm::Instruction*,
             const llvm::Value*,
             llvm::AAMemoryLocation::AccessKind,
             llvm::AAMemoryLocation::
                 MemoryLocationsKind)> Pred,
    llvm::AAMemoryLocation::MemoryLocationsKind
        MLK) const

Description

Check \p Pred on all accesses to the memory kinds specified by \p MLK. This method will evaluate \p Pred on all accesses (access instruction + underlying accessed memory pointer) and it will return true if \p Pred holds every time.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4254

Parameters

function_ref<bool( const llvm::Instruction*, const llvm::Value*, llvm::AAMemoryLocation::AccessKind, llvm::AAMemoryLocation::MemoryLocationsKind)> Pred
llvm::AAMemoryLocation::MemoryLocationsKind MLK

static bool classof(
    const llvm::AbstractAttribute* AA)

Description

This function should return true if the type of the \p AA is AAMemoryLocation

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4277

Parameters

const llvm::AbstractAttribute* AA

static llvm::AAMemoryLocation& createForPosition(
    const llvm::IRPosition& IRP,
    llvm::Attributor& A)

Description

Create an abstract attribute view for the position \p IRP.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4261

Parameters

const llvm::IRPosition& IRP
llvm::Attributor& A

const std::string getAsStr() const

Description

See AbstractState::getAsStr().

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4265

llvm::AAMemoryLocation::MemoryLocationsKind
getAssumedNotAccessedLocation() const

Description

Return the locations that are assumed to be not accessed by the associated function, if any.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4223

const char* getIdAddr() const

Description

See AbstractAttribute::getIdAddr()

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4273

static std::string getMemoryLocationsAsStr(
    llvm::AAMemoryLocation::MemoryLocationsKind
        MLK)

Description

Return the locations encoded by \p MLK as a readable string.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4239

Parameters

llvm::AAMemoryLocation::MemoryLocationsKind MLK

const std::string getName() const

Description

See AbstractAttribute::getName()

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4270

static llvm::AAMemoryLocation::MemoryLocationsKind
inverseLocation(
    llvm::AAMemoryLocation::MemoryLocationsKind
        Loc,
    bool AndLocalMem,
    bool AndConstMem)

Description

Return the inverse of location \p Loc, thus for NO_XXX the return describes ONLY_XXX. The flags \p AndLocalMem and \p AndConstMem determine if local (=stack) and constant memory are allowed as well. Most of the time we do want them to be included, e.g., argmemonly allows accesses via argument pointers or local or constant memory accesses.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4233

Parameters

llvm::AAMemoryLocation::MemoryLocationsKind Loc
bool AndLocalMem
bool AndConstMem

bool isAssumedArgMemOnly() const

Description

Return true if we assume that the underlying value will only access argument pointees (see Attribute::ArgMemOnly).

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4191

bool isAssumedInaccessibleMemOnly() const

Description

Return true if we assume that the underlying value will only access inaccesible memory only (see Attribute::InaccessibleMemOnly).

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4179

bool isAssumedInaccessibleOrArgMemOnly() const

Description

Return true if we assume that the underlying value will only access inaccesible memory or argument pointees (see Attribute::InaccessibleOrArgMemOnly).

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4206

bool isAssumedReadNone() const

Description

Return true if we assume that the associated functions has no observable accesses.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4155

bool isAssumedSpecifiedMemOnly(
    llvm::AAMemoryLocation::MemoryLocationsKind
        MLK) const

Description

Return true if only the memory locations specififed by \p MLK are assumed to be accessed by the associated function.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4217

Parameters

llvm::AAMemoryLocation::MemoryLocationsKind MLK

bool isAssumedStackOnly() const

Description

Return true if we assume that the associated functions has at most local/stack accesses.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4167

bool isKnowStackOnly() const

Description

Return true if we know that the associated functions has at most local/stack accesses.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4161

bool isKnownArgMemOnly() const

Description

Return true if we know that the underlying value will only access argument pointees (see Attribute::ArgMemOnly).

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4185

bool isKnownInaccessibleMemOnly() const

Description

Return true if we know that the underlying value will only access inaccesible memory only (see Attribute::InaccessibleMemOnly).

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4173

bool isKnownInaccessibleOrArgMemOnly() const

Description

Return true if we know that the underlying value will only access inaccesible memory or argument pointees (see Attribute::InaccessibleOrArgMemOnly).

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4198

bool isKnownReadNone() const

Description

Return true if we know that the associated functions has no observable accesses.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4151

bool mayAccessArgMem() const

Description

Return true if the underlying value may access memory through arguement pointers of the associated function, if any.

Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:4213