LLVM 17.0.0git
llvm::AAQueryInfo Class Reference

This class stores info we want to provide to or retain within an alias query. More...

#include "llvm/Analysis/AliasAnalysis.h"

Inheritance diagram for llvm::AAQueryInfo:
[legend]
Collaboration diagram for llvm::AAQueryInfo:
[legend]

## Classes

struct  CacheEntry

## Public Types

using LocPair = std::pair< AACacheLoc, AACacheLoc >

using AliasCacheT = SmallDenseMap< LocPair, CacheEntry, 8 >

## Public Member Functions

AAQueryInfo (AAResults &AAR, CaptureInfo *CI)

## Public Attributes

AAResultsAAR

AliasCacheT AliasCache

CaptureInfoCI

unsigned Depth = 0
Query depth used to distinguish recursive queries.

int NumAssumptionUses = 0
How many active NoAlias assumption uses there are.

SmallVector< AAQueryInfo::LocPair, 4 > AssumptionBasedResults
Location pairs for which an assumption based result is currently stored.

bool MayBeCrossIteration = false
Tracks whether the accesses may be on different cycle iterations.

## Detailed Description

This class stores info we want to provide to or retain within an alias query.

By default, the root query is stateless and starts with a freshly constructed info object. Specific alias analyses can use this query info to store per-query state that is important for recursive or nested queries to avoid recomputing. To enable preserving this state across multiple queries where safe (due to the IR not changing), use a BatchAAResults wrapper. The information stored in an AAQueryInfo is currently limitted to the caches used by BasicAA, but can further be extended to fit other AA needs.

Definition at line 233 of file AliasAnalysis.h.

## ◆ AliasCacheT

 using llvm::AAQueryInfo::AliasCacheT = SmallDenseMap

Definition at line 249 of file AliasAnalysis.h.

## ◆ LocPair

 using llvm::AAQueryInfo::LocPair = std::pair

Definition at line 235 of file AliasAnalysis.h.

## ◆ AAQueryInfo()

 llvm::AAQueryInfo::AAQueryInfo ( AAResults & AAR, CaptureInfo * CI )
inline

Definition at line 281 of file AliasAnalysis.h.

## ◆ AAR

 AAResults& llvm::AAQueryInfo::AAR

## ◆ AliasCache

 AliasCacheT llvm::AAQueryInfo::AliasCache

Definition at line 250 of file AliasAnalysis.h.

## ◆ AssumptionBasedResults

 SmallVector llvm::AAQueryInfo::AssumptionBasedResults

Location pairs for which an assumption based result is currently stored.

Used to remove all potentially incorrect results from the cache if an assumption is disproven.

Definition at line 263 of file AliasAnalysis.h.

## ◆ CI

 CaptureInfo* llvm::AAQueryInfo::CI

Definition at line 252 of file AliasAnalysis.h.

Referenced by llvm::BasicAAResult::getModRefInfo().

## ◆ Depth

 unsigned llvm::AAQueryInfo::Depth = 0

Query depth used to distinguish recursive queries.

Definition at line 255 of file AliasAnalysis.h.

Referenced by llvm::AAResults::alias().

## ◆ MayBeCrossIteration

 bool llvm::AAQueryInfo::MayBeCrossIteration = false

Tracks whether the accesses may be on different cycle iterations.

When interpret "Value" pointer equality as value equality we need to make sure that the "Value" is not part of a cycle. Otherwise, two uses could come from different "iterations" of a cycle and see different values for the same "Value" pointer.

The following example shows the problem: p = phi(alloca1, addr2) l = load ptr addr1 = gep, alloca2, 0, l addr2 = gep alloca2, 0, (l + 1) alias(p, addr1) -> MayAlias ! store l, ...

Definition at line 279 of file AliasAnalysis.h.

Referenced by llvm::BatchAAResults::enableCrossIterationMode().

## ◆ NumAssumptionUses

 int llvm::AAQueryInfo::NumAssumptionUses = 0

How many active NoAlias assumption uses there are.

Definition at line 258 of file AliasAnalysis.h.

The documentation for this class was generated from the following file: