struct AAPotentialConstantValues

Declaration

struct AAPotentialConstantValues : public StateWrapper { /* full declaration omitted */ };

Description

An abstract interface for potential values analysis. This AA collects potential values for each IR position. An assumed set of potential values is initialized with the empty set (the best state) and it will grow monotonically as we find more potential values for this position. The set might be forced to the worst state, that is, to contain every possible value for this position in 2 cases. 1. We surpassed the \p MaxPotentialValues threshold. This includes the case that this position is affected (e.g. because of an operation) by a Value that is in the worst state. 2. We tried to initialize on a Value that we cannot handle (e.g. an operator we do not currently handle). For non constant integers see AAPotentialValues.

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

Inherits from: StateWrapper

Member Variables

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

Method Overview

  • public AAPotentialConstantValues(const llvm::IRPosition & IRP, llvm::Attributor & A)
  • public static bool classof(const llvm::AbstractAttribute * AA)
  • public static llvm::AAPotentialConstantValues & createForPosition(const llvm::IRPosition & IRP, llvm::Attributor & A)
  • public Optional<llvm::Constant *> getAssumedConstant(llvm::Attributor & A, const llvm::Instruction * CtxI = nullptr) const
  • public const char * getIdAddr() const
  • public const std::string getName() const
  • public llvm::PotentialConstantIntValuesState & getState()
  • public const llvm::PotentialConstantIntValuesState & getState() const

Methods

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

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

Parameters

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

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

Description

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

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

Parameters

const llvm::AbstractAttribute* AA

static llvm::AAPotentialConstantValues&
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:4561

Parameters

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

Optional<llvm::Constant*> getAssumedConstant(
    llvm::Attributor& A,
    const llvm::Instruction* CtxI = nullptr) const

Description

Return assumed constant for the associated value

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

Parameters

llvm::Attributor& A
const llvm::Instruction* CtxI = nullptr

const char* getIdAddr() const

Description

See AbstractAttribute::getIdAddr()

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

const std::string getName() const

Description

See AbstractAttribute::getName()

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

llvm::PotentialConstantIntValuesState& getState()

Description

See AbstractAttribute::getState(...).

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

const llvm::PotentialConstantIntValuesState&
getState() const

Description

See AbstractAttribute::getState(...).

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