class AssumptionCache

Declaration

class AssumptionCache { /* full declaration omitted */ };

Description

A cache of @ llvm.assume calls within a function. This cache provides fast lookup of assumptions within a function by caching them and amortizing the cost of scanning for them across all queries. Passes that create new assumptions are required to call registerAssumption() to register any new @ llvm.assume calls that they create. Deletions of @ llvm.assume calls do not require special handling.

Declared at: llvm/include/llvm/Analysis/AssumptionCache.h:41

Method Overview

Methods

AssumptionCache(llvm::Function& F)

Description

Construct an AssumptionCache from a function by scanning all of its instructions.

Declared at: llvm/include/llvm/Analysis/AssumptionCache.h:91

Parameters

llvm::Function& F

MutableArrayRef<llvm::WeakTrackingVH>
assumptions()

Description

Access the list of assumption handles currently tracked for this function. Note that these produce weak handles that may be null. The caller must handle that case. FIXME: We should replace this with pointee_iterator <filter _iterator < ...>> when we can write that to filter out the null values. Then caller code will become simpler.

Declared at: llvm/include/llvm/Analysis/AssumptionCache.h:131

MutableArrayRef<llvm::WeakTrackingVH>
assumptionsFor(const llvm::Value* V)

Description

Access the list of assumptions which affect this value.

Declared at: llvm/include/llvm/Analysis/AssumptionCache.h:138

Parameters

const llvm::Value* V

void clear()

Description

Clear the cache of @ llvm.assume intrinsics for a function. It will be re-scanned the next time it is requested.

Declared at: llvm/include/llvm/Analysis/AssumptionCache.h:117

bool invalidate(
    llvm::Function&,
    const llvm::PreservedAnalyses&,
    FunctionAnalysisManager::Invalidator&)

Description

This cache is designed to be self-updating and so it should never be invalidated.

Declared at: llvm/include/llvm/Analysis/AssumptionCache.h:95

Parameters

llvm::Function&
const llvm::PreservedAnalyses&
FunctionAnalysisManager::Invalidator&

void registerAssumption(llvm::CallInst* CI)

Description

Add an @ llvm.assume intrinsic to this function's cache. The call passed in must be an instruction within this function and must not already be in the cache.

Declared at: llvm/include/llvm/Analysis/AssumptionCache.h:104

Parameters

llvm::CallInst* CI

void unregisterAssumption(llvm::CallInst* CI)

Description

Remove an @ llvm.assume intrinsic from this function's cache if it has been added to the cache earlier.

Declared at: llvm/include/llvm/Analysis/AssumptionCache.h:108

Parameters

llvm::CallInst* CI

void updateAffectedValues(llvm::CallInst* CI)

Description

Update the cache of values being affected by this assumption (i.e. the values about which this assumption provides information).

Declared at: llvm/include/llvm/Analysis/AssumptionCache.h:112

Parameters

llvm::CallInst* CI