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

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

Public Member Functions

bool hasPointerDeref () const
 Return true if any step is a PointerDeref.
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}
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 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.

◆ 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: