LLVM 24.0.0git
llvm::EarliestEscapeAnalysis Class Referencefinal

Context-sensitive CaptureAnalysis provider, which computes and caches the earliest common dominator closure of all captures. More...

#include "llvm/Analysis/AliasAnalysis.h"

Inheritance diagram for llvm::EarliestEscapeAnalysis:
[legend]

Public Member Functions

 EarliestEscapeAnalysis (DominatorTree &DT, const LoopInfo *LI=nullptr, const CycleInfo *CI=nullptr)
CaptureComponents getCapturesBefore (const Value *Object, const Instruction *I, bool OrAt, bool ReturnCaptures) override
 Return how Object may be captured before instruction I, considering only provenance captures.
void removeInstruction (Instruction *I)
void insertPotentialCapture (const Instruction *I)
 Notify the analysis that I is about to be inserted or moved.
Public Member Functions inherited from llvm::CaptureAnalysis
virtual ~CaptureAnalysis ()=0

Detailed Description

Context-sensitive CaptureAnalysis provider, which computes and caches the earliest common dominator closure of all captures.

It provides a good approximation to a precise "captures before" analysis.

Users must call removeInstruction() and insertPotentialCapture() on IR changes. The CFG must not gain paths between existing blocks and blocks must not be renumbered.

Definition at line 182 of file AliasAnalysis.h.

Constructor & Destructor Documentation

◆ EarliestEscapeAnalysis()

EarliestEscapeAnalysis::EarliestEscapeAnalysis ( DominatorTree & DT,
const LoopInfo * LI = nullptr,
const CycleInfo * CI = nullptr )

Definition at line 228 of file BasicAliasAnalysis.cpp.

References getParent(), and getRoot().

Member Function Documentation

◆ getCapturesBefore()

CaptureComponents EarliestEscapeAnalysis::getCapturesBefore ( const Value * Object,
const Instruction * I,
bool OrAt,
bool ReturnCaptures )
overridevirtual

Return how Object may be captured before instruction I, considering only provenance captures.

If OrAt is true, captures by instruction I itself are also considered.

If I is nullptr, then captures at any point will be considered.

Implements llvm::CaptureAnalysis.

Definition at line 234 of file BasicAliasAnalysis.cpp.

References assert(), llvm::Instruction::comesBefore(), llvm::FindEarliestCapture(), llvm::Function::getBlockNumberEpoch(), llvm::BasicBlock::getNumber(), llvm::BasicBlock::getParent(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), I, llvm::isIdentifiedFunctionLocal(), isNotInCycle(), llvm::isPotentiallyReachable(), llvm::None, and llvm::Provenance.

Referenced by isFuncLocalAndNotCaptured().

◆ insertPotentialCapture()

void EarliestEscapeAnalysis::insertPotentialCapture ( const Instruction * I)

Notify the analysis that I is about to be inserted or moved.

If I may capture a pointer, any cached earliest escape may no longer precede all captures, so the whole cache is dropped.

Definition at line 309 of file BasicAliasAnalysis.cpp.

References llvm::capturesAnyProvenance(), llvm::DetermineUseCaptureKind(), and I.

◆ removeInstruction()

void EarliestEscapeAnalysis::removeInstruction ( Instruction * I)

Definition at line 300 of file BasicAliasAnalysis.cpp.

References I.


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