LLVM  14.0.0git
Public Member Functions | List of all members
AACaptureUseTracker Struct Referencefinal

Attributor-aware capture tracker. More...

Inheritance diagram for AACaptureUseTracker:
Inheritance graph
[legend]
Collaboration diagram for AACaptureUseTracker:
Collaboration graph
[legend]

Public Member Functions

 AACaptureUseTracker (Attributor &A, AANoCapture &NoCaptureAA, const AAIsDead &IsDeadAA, AANoCapture::StateType &State, SmallSetVector< Value *, 4 > &PotentialCopies, unsigned &RemainingUsesToExplore)
 Create a capture tracker that can lookup in-flight abstract attributes through the Attributor A. More...
 
bool valueMayBeCaptured (const Value *V)
 Determine if V maybe captured. Also updates the state! More...
 
void tooManyUses () override
 See CaptureTracker::tooManyUses(). More...
 
bool isDereferenceableOrNull (Value *O, const DataLayout &DL) override
 isDereferenceableOrNull - Overload to allow clients with additional knowledge about pointer dereferenceability to provide it and thereby avoid conservative responses when a pointer is compared to null. More...
 
bool captured (const Use *U) override
 See CaptureTracker::captured(...). More...
 
void addPotentialCopy (CallBase &CB)
 Register CS as potential copy of the value we are checking. More...
 
bool shouldExplore (const Use *U) override
 See CaptureTracker::shouldExplore(...). More...
 
bool isCapturedIn (bool CapturedInMem, bool CapturedInInt, bool CapturedInRet)
 Update the state according to CapturedInMem, CapturedInInt, and CapturedInRet, then return the appropriate value for use in the CaptureTracker::captured() interface. More...
 
- Public Member Functions inherited from llvm::CaptureTracker
virtual ~CaptureTracker ()
 

Detailed Description

Attributor-aware capture tracker.

Definition at line 4749 of file AttributorAttributes.cpp.

Constructor & Destructor Documentation

◆ AACaptureUseTracker()

AACaptureUseTracker::AACaptureUseTracker ( Attributor A,
AANoCapture NoCaptureAA,
const AAIsDead IsDeadAA,
AANoCapture::StateType &  State,
SmallSetVector< Value *, 4 > &  PotentialCopies,
unsigned &  RemainingUsesToExplore 
)
inline

Create a capture tracker that can lookup in-flight abstract attributes through the Attributor A.

If a use leads to a potential capture, CapturedInMemory is set and the search is stopped. If a use leads to a return instruction, CommunicatedBack is set to true and CapturedInMemory is not changed. If a use leads to a ptr2int which may capture the value, CapturedInInteger is set. If a use is found that is currently assumed "no-capture-maybe-returned", the user is added to the PotentialCopies set. All values in PotentialCopies are later tracked as well. For every explored use we decrement RemainingUsesToExplore. Once it reaches 0, the search is stopped with CapturedInMemory and CapturedInInteger conservatively set to true.

Definition at line 4764 of file AttributorAttributes.cpp.

Member Function Documentation

◆ addPotentialCopy()

void AACaptureUseTracker::addPotentialCopy ( CallBase CB)
inline

Register CS as potential copy of the value we are checking.

Definition at line 4867 of file AttributorAttributes.cpp.

◆ captured()

bool AACaptureUseTracker::captured ( const Use U)
inlineoverridevirtual

◆ isCapturedIn()

bool AACaptureUseTracker::isCapturedIn ( bool  CapturedInMem,
bool  CapturedInInt,
bool  CapturedInRet 
)
inline

Update the state according to CapturedInMem, CapturedInInt, and CapturedInRet, then return the appropriate value for use in the CaptureTracker::captured() interface.

Definition at line 4881 of file AttributorAttributes.cpp.

References llvm::dbgs(), LLVM_DEBUG, llvm::AANoCapture::NO_CAPTURE_MAYBE_RETURNED, llvm::AANoCapture::NOT_CAPTURED_IN_INT, llvm::AANoCapture::NOT_CAPTURED_IN_MEM, and llvm::AANoCapture::NOT_CAPTURED_IN_RET.

◆ isDereferenceableOrNull()

bool AACaptureUseTracker::isDereferenceableOrNull ( Value O,
const DataLayout DL 
)
inlineoverridevirtual

isDereferenceableOrNull - Overload to allow clients with additional knowledge about pointer dereferenceability to provide it and thereby avoid conservative responses when a pointer is compared to null.

Reimplemented from llvm::CaptureTracker.

Definition at line 4787 of file AttributorAttributes.cpp.

References DL, llvm::AADereferenceable::getAssumedDereferenceableBytes(), llvm::CaptureTracker::isDereferenceableOrNull(), llvm::RISCVFenceField::O, llvm::OPTIONAL, and llvm::IRPosition::value().

◆ shouldExplore()

bool AACaptureUseTracker::shouldExplore ( const Use U)
inlineoverridevirtual

See CaptureTracker::shouldExplore(...).

Reimplemented from llvm::CaptureTracker.

Definition at line 4870 of file AttributorAttributes.cpp.

◆ tooManyUses()

void AACaptureUseTracker::tooManyUses ( )
inlineoverridevirtual

See CaptureTracker::tooManyUses().

Implements llvm::CaptureTracker.

Definition at line 4783 of file AttributorAttributes.cpp.

References llvm::AANoCapture::NO_CAPTURE.

◆ valueMayBeCaptured()

bool AACaptureUseTracker::valueMayBeCaptured ( const Value V)
inline

Determine if V maybe captured. Also updates the state!

Definition at line 4773 of file AttributorAttributes.cpp.

References llvm::Value::getType(), llvm::Type::isPointerTy(), llvm::AANoCapture::NO_CAPTURE_MAYBE_RETURNED, and llvm::PointerMayBeCaptured().

Referenced by AANoCaptureImpl::updateImpl().


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