FLANG
fir::AliasAnalysis::Source::AccessPath Struct Reference

#include <flang/Optimizer/Analysis/AliasAnalysis.h>

Public Member Functions

bool mayHavePointerDeref () const
bool operator== (const AccessPath &o) const
bool operator!= (const AccessPath &o) const
void print (llvm::raw_ostream &os) const

Public Attributes

llvm::SmallVector< PathStep, 4 > steps
bool isApproximate {false}
bool isIncomplete {false}
mlir::Operation * storageDecl {nullptr}

Detailed Description

The access path from the root variable to the queried memory location. For example, given: type(outer) :: x ! outer has component "in" of type inner ! inner has pointer component "p" the target address of xinp (i.e. the data xinp points to) is: [{Component,"in"}, {Component,"p"}, {PointerDeref}] where PointerDeref represents loading the pointer descriptor and extracting the target address (fir.load + fir.box_addr in the IR). This enables disambiguation of accesses to different components of the same derived-type variable and tracks pointer dereferences for pointer/target aliasing (Fortran 2018 8.5.7, 15.5.2.13).

Member Function Documentation

◆ mayHavePointerDeref()

bool fir::AliasAnalysis::Source::AccessPath::mayHavePointerDeref ( ) const
inline

Return true if any step is a PointerDeref, or if the path is incomplete, since the missing steps may include one.

Member Data Documentation

◆ isApproximate

bool fir::AliasAnalysis::Source::AccessPath::isApproximate {false}

Whether the path is approximate (e.g. contains array indexing or went through PackArrayOp). An approximate path cannot yield MustAlias.

◆ isIncomplete

bool fir::AliasAnalysis::Source::AccessPath::isIncomplete {false}

Whether steps may be missing from the start of the path: different paths of region branch predecessors are merged into an empty path, and the steps after the merge are appended to it.

◆ storageDecl

mlir::Operation* fir::AliasAnalysis::Source::AccessPath::storageDecl {nullptr}

The storage-associated (EQUIVALENCE/COMMON) declaration crossed by the path, if any. Objects of the same type may partially overlap only through storage association, so component steps are only compared between paths crossing the same such declaration.


The documentation for this struct was generated from the following files: