LLVM  14.0.0git
llvm::AA Namespace Reference

Abstract Attribute helper functions. More...

PointerInfo

## Functions

bool isDynamicallyUnique (Attributor &A, const AbstractAttribute &QueryingAA, const Value &V)
Return true if V is dynamically unique, that is, there are no two "instances" of V at runtime with different values. More...

bool isValidInScope (const Value &V, const Function *Scope)
Return true if V is a valid value in Scope, that is a constant or an instruction/argument of Scope. More...

bool isValidAtPosition (const Value &V, const Instruction &CtxI, InformationCache &InfoCache)
Return true if V is a valid value at position CtxI, that is a constant, an argument of the same function as CtxI, or an instruction in that function that dominates CtxI. More...

ValuegetWithType (Value &V, Type &Ty)
Try to convert V to type Ty without introducing new instructions. More...

Optional< Value * > combineOptionalValuesInAAValueLatice (const Optional< Value * > &A, const Optional< Value * > &B, Type *Ty)
Return the combination of A and B such that the result is a possible value of both. More...

ConstantgetInitialValueForObj (Value &Obj, Type &Ty, const TargetLibraryInfo *TLI)
Return the initial value of Obj with type Ty if that is a constant. More...

bool getAssumedUnderlyingObjects (Attributor &A, const Value &Ptr, SmallVectorImpl< Value * > &Objects, const AbstractAttribute &QueryingAA, const Instruction *CtxI)
Collect all potential underlying objects of Ptr at position CtxI in Objects. More...

bool getPotentialCopiesOfStoredValue (Attributor &A, StoreInst &SI, SmallSetVector< Value *, 4 > &PotentialCopies, const AbstractAttribute &QueryingAA, bool &UsedAssumedInformation)
Collect all potential values of the one stored by SI into PotentialCopies. More...

## Detailed Description

Abstract Attribute helper functions.

## ◆ combineOptionalValuesInAAValueLatice()

 Optional< Value * > llvm::AA::combineOptionalValuesInAAValueLatice ( const Optional< Value * > & A, const Optional< Value * > & B, Type * Ty )

Return the combination of A and B such that the result is a possible value of both.

B is potentially casted to match the type Ty or the type of A if Ty is null.

Examples: X + none => X not_none + undef => not_none V1 + V2 => nullptr

Definition at line 269 of file Attributor.cpp.

References B, and getWithType().

## ◆ getAssumedUnderlyingObjects()

 bool llvm::AA::getAssumedUnderlyingObjects ( Attributor & A, const Value & Ptr, SmallVectorImpl< Value * > & Objects, const AbstractAttribute & QueryingAA, const Instruction * CtxI )

Collect all potential underlying objects of Ptr at position CtxI in Objects.

Assumed information is used and dependences onto QueryingAA are added appropriately.

Returns
True if Objects contains all assumed underlying objects, and false if something went wrong and the objects could not be determined.

Definition at line 375 of file AttributorAttributes.cpp.

Referenced by getPotentialCopiesOfStoredValue().

## ◆ getInitialValueForObj()

 Constant * llvm::AA::getInitialValueForObj ( Value & Obj, Type & Ty, const TargetLibraryInfo * TLI )

Return the initial value of Obj with type Ty if that is a constant.

Definition at line 206 of file Attributor.cpp.

## ◆ getPotentialCopiesOfStoredValue()

 bool llvm::AA::getPotentialCopiesOfStoredValue ( Attributor & A, StoreInst & SI, SmallSetVector< Value *, 4 > & PotentialCopies, const AbstractAttribute & QueryingAA, bool & UsedAssumedInformation )

Collect all potential values of the one stored by SI into PotentialCopies.

That is, the only copies that were made via the store are assumed to be known and all in PotentialCopies. Dependences onto QueryingAA are properly tracked, UsedAssumedInformation will inform the caller if assumed information was used.

Returns
True if the assumed potential copies are all in PotentialCopies, false if something went wrong and the copies could not be determined.

Definition at line 292 of file Attributor.cpp.

Referenced by llvm::Attributor::checkForAllUses().

## ◆ getWithType()

 Value * llvm::AA::getWithType ( Value & V, Type & Ty )

Try to convert V to type Ty without introducing new instructions.

If this is not possible return nullptr. Note: this function basically knows how to cast various constants.

Definition at line 246 of file Attributor.cpp.

## ◆ isDynamicallyUnique()

 bool llvm::AA::isDynamicallyUnique ( Attributor & A, const AbstractAttribute & QueryingAA, const Value & V )

Return true if V is dynamically unique, that is, there are no two "instances" of V at runtime with different values.

}

Definition at line 186 of file Attributor.cpp.

## ◆ isValidAtPosition()

 bool llvm::AA::isValidAtPosition ( const Value & V, const Instruction & CtxI, InformationCache & InfoCache )

Return true if V is a valid value at position CtxI, that is a constant, an argument of the same function as CtxI, or an instruction in that function that dominates CtxI.

Definition at line 230 of file Attributor.cpp.

## ◆ isValidInScope()

 bool llvm::AA::isValidInScope ( const Value & V, const Function * Scope )

Return true if V is a valid value in Scope, that is a constant or an instruction/argument of Scope.

Definition at line 220 of file Attributor.cpp.

References I.