struct DerefState

Declaration

struct DerefState : public AbstractState { /* full declaration omitted */ };

Description

State for dereferenceable attribute

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

Inherits from: AbstractState

Member Variables

public IncIntegerState<> DerefBytesState
State representing for dereferenceable bytes.
public std::map<int64_t, uint64_t> AccessedBytesMap
Map representing for accessed memory offsets and sizes. A key is Offset and a value is size. If there is a load/store instruction something like, p[offset] = v; (offset, sizeof(v)) will be inserted to this map. std::map is used because we want to iterate keys in ascending order.
public llvm::BooleanState GlobalState
State representing that whether the value is globaly dereferenceable.
protected const llvm::AANonNull* NonNullAA = nullptr

Method Overview

Inherited from AbstractState:

Methods

void addAccessedBytes(int64_t Offset,
                      uint64_t Size)

Description

Add accessed bytes to the map.

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

Parameters

int64_t Offset
uint64_t Size

void computeKnownDerefBytesFromAccessedMap()

Description

Helper function to calculate dereferenceable bytes from current known bytes and accessed bytes. int f(int *A){ *A = 0; *(A+2) = 2; *(A+1) = 1; *(A+10) = 10; } ``` In that case, AccessedBytesMap is `{0:4, 4:4, 8:4, 40:4}`. AccessedBytesMap is std::map so it is iterated in accending order on key(Offset). So KnownBytes will be updated like this: |Access | KnownBytes |(0, 4)| 0 -> 4 |(4, 4)| 4 -> 8 |(8, 4)| 8 -> 12 |(40, 4) | 12 (break)

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

llvm::ChangeStatus indicateOptimisticFixpoint()

Description

See AbstractState::indicateOptimisticFixpoint(...)

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

llvm::ChangeStatus indicatePessimisticFixpoint()

Description

See AbstractState::indicatePessimisticFixpoint(...)

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

bool isAtFixpoint() const

Description

See AbstractState::isAtFixpoint()

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

bool isValidState() const

Description

See AbstractState::isValidState()

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

void takeAssumedDerefBytesMinimum(uint64_t Bytes)

Description

Update assumed dereferenceable bytes.

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

Parameters

uint64_t Bytes

void takeKnownDerefBytesMaximum(uint64_t Bytes)

Description

Update known dereferenceable bytes.

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

Parameters

uint64_t Bytes