#include "llvm/Transforms/IPO/Attributor.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SCCIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/AssumeBundleQueries.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/CaptureTracking.h"
#include "llvm/Analysis/CycleAnalysis.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/LazyValueInfo.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/Assumptions.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include "llvm/IR/IntrinsicsNVPTX.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/NoFolder.h"
#include "llvm/IR/Value.h"
#include "llvm/IR/ValueHandle.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/GraphWriter.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/TypeSize.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/CallPromotionUtils.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
#include <cassert>
#include <numeric>
#include <optional>
#include <string>
usingnamespacellvm;
#define DEBUG_TYPE …
static cl::opt<bool> ManifestInternal(
"attributor-manifest-internal", cl::Hidden,
cl::desc("Manifest Attributor internal string attributes."),
cl::init(false));
static cl::opt<int> MaxHeapToStackSize("max-heap-to-stack-size", cl::init(128),
cl::Hidden);
template <>
unsigned llvm::PotentialConstantIntValuesState::MaxPotentialValues = …;
template <> unsigned llvm::PotentialLLVMValuesState::MaxPotentialValues = …;
static cl::opt<unsigned, true> MaxPotentialValues(
"attributor-max-potential-values", cl::Hidden,
cl::desc("Maximum number of potential values to be "
"tracked for each position."),
cl::location(llvm::PotentialConstantIntValuesState::MaxPotentialValues),
cl::init(7));
static cl::opt<int> MaxPotentialValuesIterations(
"attributor-max-potential-values-iterations", cl::Hidden,
cl::desc(
"Maximum number of iterations we keep dismantling potential values."),
cl::init(64));
STATISTIC(NumAAs, "Number of abstract attributes created");
STATISTIC(NumIndirectCallsPromoted, "Number of indirect calls promoted");
#define BUILD_STAT_MSG_IR_ATTR(TYPE, NAME) …
#define BUILD_STAT_NAME(NAME, TYPE) …
#define STATS_DECL_(NAME, MSG) …
#define STATS_DECL(NAME, TYPE, MSG) …
#define STATS_TRACK(NAME, TYPE) …
#define STATS_DECLTRACK(NAME, TYPE, MSG) …
#define STATS_DECLTRACK_ARG_ATTR(NAME) …
#define STATS_DECLTRACK_CSARG_ATTR(NAME) …
#define STATS_DECLTRACK_FN_ATTR(NAME) …
#define STATS_DECLTRACK_CS_ATTR(NAME) …
#define STATS_DECLTRACK_FNRET_ATTR(NAME) …
#define STATS_DECLTRACK_CSRET_ATTR(NAME) …
#define STATS_DECLTRACK_FLOATING_ATTR(NAME) …
llvm
static bool mayBeInCycle(const CycleInfo *CI, const Instruction *I,
bool HeaderOnly, Cycle **CPtr = nullptr) { … }
static bool isDenselyPacked(Type *Ty, const DataLayout &DL) { … }
static const Value *getPointerOperand(const Instruction *I,
bool AllowVolatile) { … }
static Value *constructPointer(Value *Ptr, int64_t Offset,
IRBuilder<NoFolder> &IRB) { … }
static const Value *
stripAndAccumulateOffsets(Attributor &A, const AbstractAttribute &QueryingAA,
const Value *Val, const DataLayout &DL, APInt &Offset,
bool GetMinOffset, bool AllowNonInbounds,
bool UseAssumed = false) { … }
static const Value *
getMinimalBaseOfPointer(Attributor &A, const AbstractAttribute &QueryingAA,
const Value *Ptr, int64_t &BytesOffset,
const DataLayout &DL, bool AllowNonInbounds = false) { … }
template <typename AAType, typename StateType = typename AAType::StateType,
Attribute::AttrKind IRAttributeKind = AAType::IRAttributeKind,
bool RecurseForSelectAndPHI = true>
static void clampReturnedValueStates(
Attributor &A, const AAType &QueryingAA, StateType &S,
const IRPosition::CallBaseContext *CBContext = nullptr) { … }
namespace {
template <typename AAType, typename BaseType,
typename StateType = typename BaseType::StateType,
bool PropagateCallBaseContext = false,
Attribute::AttrKind IRAttributeKind = AAType::IRAttributeKind,
bool RecurseForSelectAndPHI = true>
struct AAReturnedFromReturnedValues : public BaseType { … };
template <typename AAType, typename StateType = typename AAType::StateType,
Attribute::AttrKind IRAttributeKind = AAType::IRAttributeKind>
static void clampCallSiteArgumentStates(Attributor &A, const AAType &QueryingAA,
StateType &S) { … }
template <typename AAType, typename BaseType,
typename StateType = typename AAType::StateType,
Attribute::AttrKind IRAttributeKind = AAType::IRAttributeKind>
bool getArgumentStateFromCallBaseContext(Attributor &A,
BaseType &QueryingAttribute,
IRPosition &Pos, StateType &State) { … }
template <typename AAType, typename BaseType,
typename StateType = typename AAType::StateType,
bool BridgeCallBaseContext = false,
Attribute::AttrKind IRAttributeKind = AAType::IRAttributeKind>
struct AAArgumentFromCallSiteArguments : public BaseType { … };
template <typename AAType, typename BaseType,
typename StateType = typename BaseType::StateType,
bool IntroduceCallBaseContext = false,
Attribute::AttrKind IRAttributeKind = AAType::IRAttributeKind>
struct AACalleeToCallSite : public BaseType { … };
template <class AAType, typename StateType = typename AAType::StateType>
static void followUsesInContext(AAType &AA, Attributor &A,
MustBeExecutedContextExplorer &Explorer,
const Instruction *CtxI,
SetVector<const Use *> &Uses,
StateType &State) { … }
template <class AAType, typename StateType = typename AAType::StateType>
static void followUsesInMBEC(AAType &AA, Attributor &A, StateType &S,
Instruction &CtxI) { … }
}
namespace llvm {
namespace AA {
namespace PointerInfo {
struct State;
}
}
template <>
struct DenseMapInfo<AAPointerInfo::Access> : DenseMapInfo<Instruction *> { … };
template <> struct DenseMapInfo<AA::RangeTy> { … };
struct AccessAsInstructionInfo : DenseMapInfo<Instruction *> { … };
}
struct AA::PointerInfo::State : public AbstractState { … };
ChangeStatus AA::PointerInfo::State::addAccess(
Attributor &A, const AAPointerInfo::RangeList &Ranges, Instruction &I,
std::optional<Value *> Content, AAPointerInfo::AccessKind Kind, Type *Ty,
Instruction *RemoteI) { … }
namespace {
#ifndef NDEBUG
static raw_ostream &operator<<(raw_ostream &OS,
const AAPointerInfo::OffsetInfo &OI) {
ListSeparator LS;
OS << "[";
for (auto Offset : OI) {
OS << LS << Offset;
}
OS << "]";
return OS;
}
#endif
struct AAPointerInfoImpl
: public StateWrapper<AA::PointerInfo::State, AAPointerInfo> { … };
struct AAPointerInfoFloating : public AAPointerInfoImpl { … };
bool AAPointerInfoFloating::collectConstantsForGEP(Attributor &A,
const DataLayout &DL,
OffsetInfo &UsrOI,
const OffsetInfo &PtrOI,
const GEPOperator *GEP) { … }
ChangeStatus AAPointerInfoFloating::updateImpl(Attributor &A) { … }
struct AAPointerInfoReturned final : AAPointerInfoImpl { … };
struct AAPointerInfoArgument final : AAPointerInfoFloating { … };
struct AAPointerInfoCallSiteArgument final : AAPointerInfoFloating { … };
struct AAPointerInfoCallSiteReturned final : AAPointerInfoFloating { … };
}
namespace {
struct AANoUnwindImpl : AANoUnwind { … };
struct AANoUnwindFunction final : public AANoUnwindImpl { … };
struct AANoUnwindCallSite final
: AACalleeToCallSite<AANoUnwind, AANoUnwindImpl> { … };
}
bool AANoSync::isAlignedBarrier(const CallBase &CB, bool ExecutedAligned) { … }
bool AANoSync::isNonRelaxedAtomic(const Instruction *I) { … }
bool AANoSync::isNoSyncIntrinsic(const Instruction *I) { … }
namespace {
struct AANoSyncImpl : AANoSync { … };
ChangeStatus AANoSyncImpl::updateImpl(Attributor &A) { … }
struct AANoSyncFunction final : public AANoSyncImpl { … };
struct AANoSyncCallSite final : AACalleeToCallSite<AANoSync, AANoSyncImpl> { … };
}
namespace {
struct AANoFreeImpl : public AANoFree { … };
struct AANoFreeFunction final : public AANoFreeImpl { … };
struct AANoFreeCallSite final : AACalleeToCallSite<AANoFree, AANoFreeImpl> { … };
struct AANoFreeFloating : AANoFreeImpl { … };
struct AANoFreeArgument final : AANoFreeFloating { … };
struct AANoFreeCallSiteArgument final : AANoFreeFloating { … };
struct AANoFreeReturned final : AANoFreeFloating { … };
struct AANoFreeCallSiteReturned final : AANoFreeFloating { … };
}
bool AANonNull::isImpliedByIR(Attributor &A, const IRPosition &IRP,
Attribute::AttrKind ImpliedAttributeKind,
bool IgnoreSubsumingPositions) { … }
namespace {
static int64_t getKnownNonNullAndDerefBytesForUse(
Attributor &A, const AbstractAttribute &QueryingAA, Value &AssociatedValue,
const Use *U, const Instruction *I, bool &IsNonNull, bool &TrackUse) { … }
struct AANonNullImpl : AANonNull { … };
struct AANonNullFloating : public AANonNullImpl { … };
struct AANonNullReturned final
: AAReturnedFromReturnedValues<AANonNull, AANonNull, AANonNull::StateType,
false, AANonNull::IRAttributeKind, false> { … };
struct AANonNullArgument final
: AAArgumentFromCallSiteArguments<AANonNull, AANonNullImpl> { … };
struct AANonNullCallSiteArgument final : AANonNullFloating { … };
struct AANonNullCallSiteReturned final
: AACalleeToCallSite<AANonNull, AANonNullImpl> { … };
}
namespace {
struct AAMustProgressImpl : public AAMustProgress { … };
struct AAMustProgressFunction final : AAMustProgressImpl { … };
struct AAMustProgressCallSite final : AAMustProgressImpl { … };
}
namespace {
struct AANoRecurseImpl : public AANoRecurse { … };
struct AANoRecurseFunction final : AANoRecurseImpl { … };
struct AANoRecurseCallSite final
: AACalleeToCallSite<AANoRecurse, AANoRecurseImpl> { … };
}
namespace {
struct AANonConvergentImpl : public AANonConvergent { … };
struct AANonConvergentFunction final : AANonConvergentImpl { … };
}
namespace {
struct AAUndefinedBehaviorImpl : public AAUndefinedBehavior { … };
struct AAUndefinedBehaviorFunction final : AAUndefinedBehaviorImpl { … };
}
namespace {
static bool mayContainUnboundedCycle(Function &F, Attributor &A) { … }
struct AAWillReturnImpl : public AAWillReturn { … };
struct AAWillReturnFunction final : AAWillReturnImpl { … };
struct AAWillReturnCallSite final
: AACalleeToCallSite<AAWillReturn, AAWillReturnImpl> { … };
}
template <typename ToTy> struct ReachabilityQueryInfo { … };
llvm
namespace {
template <typename BaseTy, typename ToTy>
struct CachedReachabilityAA : public BaseTy { … };
struct AAIntraFnReachabilityFunction final
: public CachedReachabilityAA<AAIntraFnReachability, Instruction> { … };
}
bool AANoAlias::isImpliedByIR(Attributor &A, const IRPosition &IRP,
Attribute::AttrKind ImpliedAttributeKind,
bool IgnoreSubsumingPositions) { … }
namespace {
struct AANoAliasImpl : AANoAlias { … };
struct AANoAliasFloating final : AANoAliasImpl { … };
struct AANoAliasArgument final
: AAArgumentFromCallSiteArguments<AANoAlias, AANoAliasImpl> { … };
struct AANoAliasCallSiteArgument final : AANoAliasImpl { … };
struct AANoAliasReturned final : AANoAliasImpl { … };
struct AANoAliasCallSiteReturned final
: AACalleeToCallSite<AANoAlias, AANoAliasImpl> { … };
}
namespace {
struct AAIsDeadValueImpl : public AAIsDead { … };
struct AAIsDeadFloating : public AAIsDeadValueImpl { … };
struct AAIsDeadArgument : public AAIsDeadFloating { … };
struct AAIsDeadCallSiteArgument : public AAIsDeadValueImpl { … };
struct AAIsDeadCallSiteReturned : public AAIsDeadFloating { … };
struct AAIsDeadReturned : public AAIsDeadValueImpl { … };
struct AAIsDeadFunction : public AAIsDead { … };
static bool
identifyAliveSuccessors(Attributor &A, const CallBase &CB,
AbstractAttribute &AA,
SmallVectorImpl<const Instruction *> &AliveSuccessors) { … }
static bool
identifyAliveSuccessors(Attributor &A, const InvokeInst &II,
AbstractAttribute &AA,
SmallVectorImpl<const Instruction *> &AliveSuccessors) { … }
static bool
identifyAliveSuccessors(Attributor &A, const BranchInst &BI,
AbstractAttribute &AA,
SmallVectorImpl<const Instruction *> &AliveSuccessors) { … }
static bool
identifyAliveSuccessors(Attributor &A, const SwitchInst &SI,
AbstractAttribute &AA,
SmallVectorImpl<const Instruction *> &AliveSuccessors) { … }
ChangeStatus AAIsDeadFunction::updateImpl(Attributor &A) { … }
struct AAIsDeadCallSite final : AAIsDeadFunction { … };
}
namespace {
struct AADereferenceableImpl : AADereferenceable { … };
struct AADereferenceableFloating : AADereferenceableImpl { … };
struct AADereferenceableReturned final
: AAReturnedFromReturnedValues<AADereferenceable, AADereferenceableImpl> { … };
struct AADereferenceableArgument final
: AAArgumentFromCallSiteArguments<AADereferenceable,
AADereferenceableImpl> { … };
struct AADereferenceableCallSiteArgument final : AADereferenceableFloating { … };
struct AADereferenceableCallSiteReturned final
: AACalleeToCallSite<AADereferenceable, AADereferenceableImpl> { … };
}
namespace {
static unsigned getKnownAlignForUse(Attributor &A, AAAlign &QueryingAA,
Value &AssociatedValue, const Use *U,
const Instruction *I, bool &TrackUse) { … }
struct AAAlignImpl : AAAlign { … };
struct AAAlignFloating : AAAlignImpl { … };
struct AAAlignReturned final
: AAReturnedFromReturnedValues<AAAlign, AAAlignImpl> { … };
struct AAAlignArgument final
: AAArgumentFromCallSiteArguments<AAAlign, AAAlignImpl> { … };
struct AAAlignCallSiteArgument final : AAAlignFloating { … };
struct AAAlignCallSiteReturned final
: AACalleeToCallSite<AAAlign, AAAlignImpl> { … };
}
namespace {
struct AANoReturnImpl : public AANoReturn { … };
struct AANoReturnFunction final : AANoReturnImpl { … };
struct AANoReturnCallSite final
: AACalleeToCallSite<AANoReturn, AANoReturnImpl> { … };
}
namespace {
struct AAInstanceInfoImpl : public AAInstanceInfo { … };
struct AAInstanceInfoFloating : AAInstanceInfoImpl { … };
struct AAInstanceInfoArgument final : AAInstanceInfoFloating { … };
struct AAInstanceInfoCallSiteArgument final : AAInstanceInfoImpl { … };
struct AAInstanceInfoReturned final : AAInstanceInfoImpl { … };
struct AAInstanceInfoCallSiteReturned final : AAInstanceInfoFloating { … };
}
bool AANoCapture::isImpliedByIR(Attributor &A, const IRPosition &IRP,
Attribute::AttrKind ImpliedAttributeKind,
bool IgnoreSubsumingPositions) { … }
void AANoCapture::determineFunctionCaptureCapabilities(const IRPosition &IRP,
const Function &F,
BitIntegerState &State) { … }
namespace {
struct AANoCaptureImpl : public AANoCapture { … };
ChangeStatus AANoCaptureImpl::updateImpl(Attributor &A) { … }
struct AANoCaptureArgument final : AANoCaptureImpl { … };
struct AANoCaptureCallSiteArgument final : AANoCaptureImpl { … };
struct AANoCaptureFloating final : AANoCaptureImpl { … };
struct AANoCaptureReturned final : AANoCaptureImpl { … };
struct AANoCaptureCallSiteReturned final : AANoCaptureImpl { … };
}
bool ValueSimplifyStateType::unionAssumed(std::optional<Value *> Other) { … }
namespace {
struct AAValueSimplifyImpl : AAValueSimplify { … };
struct AAValueSimplifyArgument final : AAValueSimplifyImpl { … };
struct AAValueSimplifyReturned : AAValueSimplifyImpl { … };
struct AAValueSimplifyFloating : AAValueSimplifyImpl { … };
struct AAValueSimplifyFunction : AAValueSimplifyImpl { … };
struct AAValueSimplifyCallSite : AAValueSimplifyFunction { … };
struct AAValueSimplifyCallSiteReturned : AAValueSimplifyImpl { … };
struct AAValueSimplifyCallSiteArgument : AAValueSimplifyFloating { … };
}
namespace {
struct AAHeapToStackFunction final : public AAHeapToStack { … };
ChangeStatus AAHeapToStackFunction::updateImpl(Attributor &A) { … }
}
namespace {
struct AAPrivatizablePtrImpl : public AAPrivatizablePtr { … };
struct AAPrivatizablePtrArgument final : public AAPrivatizablePtrImpl { … };
struct AAPrivatizablePtrFloating : public AAPrivatizablePtrImpl { … };
struct AAPrivatizablePtrCallSiteArgument final
: public AAPrivatizablePtrFloating { … };
struct AAPrivatizablePtrCallSiteReturned final
: public AAPrivatizablePtrFloating { … };
struct AAPrivatizablePtrReturned final : public AAPrivatizablePtrFloating { … };
}
namespace {
struct AAMemoryBehaviorImpl : public AAMemoryBehavior { … };
const Attribute::AttrKind AAMemoryBehaviorImpl::AttrKinds[] = …;
struct AAMemoryBehaviorFloating : AAMemoryBehaviorImpl { … };
struct AAMemoryBehaviorArgument : AAMemoryBehaviorFloating { … };
struct AAMemoryBehaviorCallSiteArgument final : AAMemoryBehaviorArgument { … };
struct AAMemoryBehaviorCallSiteReturned final : AAMemoryBehaviorFloating { … };
struct AAMemoryBehaviorFunction final : public AAMemoryBehaviorImpl { … };
struct AAMemoryBehaviorCallSite final
: AACalleeToCallSite<AAMemoryBehavior, AAMemoryBehaviorImpl> { … };
ChangeStatus AAMemoryBehaviorFunction::updateImpl(Attributor &A) { … }
ChangeStatus AAMemoryBehaviorFloating::updateImpl(Attributor &A) { … }
bool AAMemoryBehaviorFloating::followUsersOfUseIn(Attributor &A, const Use &U,
const Instruction *UserI) { … }
void AAMemoryBehaviorFloating::analyzeUseIn(Attributor &A, const Use &U,
const Instruction *UserI) { … }
}
std::string AAMemoryLocation::getMemoryLocationsAsStr(
AAMemoryLocation::MemoryLocationsKind MLK) { … }
namespace {
struct AAMemoryLocationImpl : public AAMemoryLocation { … };
void AAMemoryLocationImpl::categorizePtrValue(
Attributor &A, const Instruction &I, const Value &Ptr,
AAMemoryLocation::StateType &State, bool &Changed, unsigned AccessAS) { … }
void AAMemoryLocationImpl::categorizeArgumentPointerLocations(
Attributor &A, CallBase &CB, AAMemoryLocation::StateType &AccessedLocs,
bool &Changed) { … }
AAMemoryLocation::MemoryLocationsKind
AAMemoryLocationImpl::categorizeAccessedLocations(Attributor &A, Instruction &I,
bool &Changed) { … }
struct AAMemoryLocationFunction final : public AAMemoryLocationImpl { … };
struct AAMemoryLocationCallSite final : AAMemoryLocationImpl { … };
}
namespace {
struct AADenormalFPMathImpl : public AADenormalFPMath { … };
struct AADenormalFPMathFunction final : AADenormalFPMathImpl { … };
}
namespace {
struct AAValueConstantRangeImpl : AAValueConstantRange { … };
struct AAValueConstantRangeArgument final
: AAArgumentFromCallSiteArguments<
AAValueConstantRange, AAValueConstantRangeImpl, IntegerRangeState,
true > { … };
struct AAValueConstantRangeReturned
: AAReturnedFromReturnedValues<AAValueConstantRange,
AAValueConstantRangeImpl,
AAValueConstantRangeImpl::StateType,
true> { … };
struct AAValueConstantRangeFloating : AAValueConstantRangeImpl { … };
struct AAValueConstantRangeFunction : AAValueConstantRangeImpl { … };
struct AAValueConstantRangeCallSite : AAValueConstantRangeFunction { … };
struct AAValueConstantRangeCallSiteReturned
: AACalleeToCallSite<AAValueConstantRange, AAValueConstantRangeImpl,
AAValueConstantRangeImpl::StateType,
true> { … };
struct AAValueConstantRangeCallSiteArgument : AAValueConstantRangeFloating { … };
}
namespace {
struct AAPotentialConstantValuesImpl : AAPotentialConstantValues { … };
struct AAPotentialConstantValuesArgument final
: AAArgumentFromCallSiteArguments<AAPotentialConstantValues,
AAPotentialConstantValuesImpl,
PotentialConstantIntValuesState> { … };
struct AAPotentialConstantValuesReturned
: AAReturnedFromReturnedValues<AAPotentialConstantValues,
AAPotentialConstantValuesImpl> { … };
struct AAPotentialConstantValuesFloating : AAPotentialConstantValuesImpl { … };
struct AAPotentialConstantValuesFunction : AAPotentialConstantValuesImpl { … };
struct AAPotentialConstantValuesCallSite : AAPotentialConstantValuesFunction { … };
struct AAPotentialConstantValuesCallSiteReturned
: AACalleeToCallSite<AAPotentialConstantValues,
AAPotentialConstantValuesImpl> { … };
struct AAPotentialConstantValuesCallSiteArgument
: AAPotentialConstantValuesFloating { … };
}
bool AANoUndef::isImpliedByIR(Attributor &A, const IRPosition &IRP,
Attribute::AttrKind ImpliedAttributeKind,
bool IgnoreSubsumingPositions) { … }
namespace {
struct AANoUndefImpl : AANoUndef { … };
struct AANoUndefFloating : public AANoUndefImpl { … };
struct AANoUndefReturned final
: AAReturnedFromReturnedValues<AANoUndef, AANoUndefImpl> { … };
struct AANoUndefArgument final
: AAArgumentFromCallSiteArguments<AANoUndef, AANoUndefImpl> { … };
struct AANoUndefCallSiteArgument final : AANoUndefFloating { … };
struct AANoUndefCallSiteReturned final
: AACalleeToCallSite<AANoUndef, AANoUndefImpl> { … };
struct AANoFPClassImpl : AANoFPClass { … };
struct AANoFPClassFloating : public AANoFPClassImpl { … };
struct AANoFPClassReturned final
: AAReturnedFromReturnedValues<AANoFPClass, AANoFPClassImpl,
AANoFPClassImpl::StateType, false,
Attribute::None, false> { … };
struct AANoFPClassArgument final
: AAArgumentFromCallSiteArguments<AANoFPClass, AANoFPClassImpl> { … };
struct AANoFPClassCallSiteArgument final : AANoFPClassFloating { … };
struct AANoFPClassCallSiteReturned final
: AACalleeToCallSite<AANoFPClass, AANoFPClassImpl> { … };
struct AACallEdgesImpl : public AACallEdges { … };
struct AACallEdgesCallSite : public AACallEdgesImpl { … };
struct AACallEdgesFunction : public AACallEdgesImpl { … };
struct AAInterFnReachabilityFunction
: public CachedReachabilityAA<AAInterFnReachability, Function> { … };
}
template <typename AAType>
static std::optional<Constant *>
askForAssumedConstant(Attributor &A, const AbstractAttribute &QueryingAA,
const IRPosition &IRP, Type &Ty) { … }
Value *AAPotentialValues::getSingleValue(
Attributor &A, const AbstractAttribute &AA, const IRPosition &IRP,
SmallVectorImpl<AA::ValueAndContext> &Values) { … }
namespace {
struct AAPotentialValuesImpl : AAPotentialValues { … };
struct AAPotentialValuesFloating : AAPotentialValuesImpl { … };
struct AAPotentialValuesArgument final : AAPotentialValuesImpl { … };
struct AAPotentialValuesReturned : public AAPotentialValuesFloating { … };
struct AAPotentialValuesFunction : AAPotentialValuesImpl { … };
struct AAPotentialValuesCallSite : AAPotentialValuesFunction { … };
struct AAPotentialValuesCallSiteReturned : AAPotentialValuesImpl { … };
struct AAPotentialValuesCallSiteArgument : AAPotentialValuesFloating { … };
}
namespace {
struct AAAssumptionInfoImpl : public AAAssumptionInfo { … };
struct AAAssumptionInfoFunction final : AAAssumptionInfoImpl { … };
struct AAAssumptionInfoCallSite final : AAAssumptionInfoImpl { … };
}
AACallGraphNode *AACallEdgeIterator::operator*() const { … }
void AttributorCallGraph::print() { … }
namespace {
struct AAUnderlyingObjectsImpl
: StateWrapper<BooleanState, AAUnderlyingObjects> { … };
struct AAUnderlyingObjectsFloating final : AAUnderlyingObjectsImpl { … };
struct AAUnderlyingObjectsArgument final : AAUnderlyingObjectsImpl { … };
struct AAUnderlyingObjectsCallSite final : AAUnderlyingObjectsImpl { … };
struct AAUnderlyingObjectsCallSiteArgument final : AAUnderlyingObjectsImpl { … };
struct AAUnderlyingObjectsReturned final : AAUnderlyingObjectsImpl { … };
struct AAUnderlyingObjectsCallSiteReturned final : AAUnderlyingObjectsImpl { … };
struct AAUnderlyingObjectsFunction final : AAUnderlyingObjectsImpl { … };
}
namespace {
struct AAGlobalValueInfoFloating : public AAGlobalValueInfo { … };
}
namespace {
struct AAIndirectCallInfoCallSite : public AAIndirectCallInfo { … };
}
namespace {
template <typename InstType>
static bool makeChange(Attributor &A, InstType *MemInst, const Use &U,
Value *OriginalValue, PointerType *NewPtrTy,
bool UseOriginalValue) { … }
struct AAAddressSpaceImpl : public AAAddressSpace { … };
struct AAAddressSpaceFloating final : AAAddressSpaceImpl { … };
struct AAAddressSpaceReturned final : AAAddressSpaceImpl { … };
struct AAAddressSpaceCallSiteReturned final : AAAddressSpaceImpl { … };
struct AAAddressSpaceArgument final : AAAddressSpaceImpl { … };
struct AAAddressSpaceCallSiteArgument final : AAAddressSpaceImpl { … };
}
namespace {
struct AAAllocationInfoImpl : public AAAllocationInfo { … };
struct AAAllocationInfoFloating : AAAllocationInfoImpl { … };
struct AAAllocationInfoReturned : AAAllocationInfoImpl { … };
struct AAAllocationInfoCallSiteReturned : AAAllocationInfoImpl { … };
struct AAAllocationInfoArgument : AAAllocationInfoImpl { … };
struct AAAllocationInfoCallSiteArgument : AAAllocationInfoImpl { … };
}
const char AANoUnwind::ID = …;
const char AANoSync::ID = …;
const char AANoFree::ID = …;
const char AANonNull::ID = …;
const char AAMustProgress::ID = …;
const char AANoRecurse::ID = …;
const char AANonConvergent::ID = …;
const char AAWillReturn::ID = …;
const char AAUndefinedBehavior::ID = …;
const char AANoAlias::ID = …;
const char AAIntraFnReachability::ID = …;
const char AANoReturn::ID = …;
const char AAIsDead::ID = …;
const char AADereferenceable::ID = …;
const char AAAlign::ID = …;
const char AAInstanceInfo::ID = …;
const char AANoCapture::ID = …;
const char AAValueSimplify::ID = …;
const char AAHeapToStack::ID = …;
const char AAPrivatizablePtr::ID = …;
const char AAMemoryBehavior::ID = …;
const char AAMemoryLocation::ID = …;
const char AAValueConstantRange::ID = …;
const char AAPotentialConstantValues::ID = …;
const char AAPotentialValues::ID = …;
const char AANoUndef::ID = …;
const char AANoFPClass::ID = …;
const char AACallEdges::ID = …;
const char AAInterFnReachability::ID = …;
const char AAPointerInfo::ID = …;
const char AAAssumptionInfo::ID = …;
const char AAUnderlyingObjects::ID = …;
const char AAAddressSpace::ID = …;
const char AAAllocationInfo::ID = …;
const char AAIndirectCallInfo::ID = …;
const char AAGlobalValueInfo::ID = …;
const char AADenormalFPMath::ID = …;
#define SWITCH_PK_INV …
#define SWITCH_PK_CREATE …
#define CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION …
#define CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION …
#define CREATE_ABSTRACT_ATTRIBUTE_FOR_ONE_POSITION …
#define CREATE_ALL_ABSTRACT_ATTRIBUTE_FOR_POSITION …
#define CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION …
#define CREATE_NON_RET_ABSTRACT_ATTRIBUTE_FOR_POSITION …
CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_ALL_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_ALL_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_ALL_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_ALL_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_ABSTRACT_ATTRIBUTE_FOR_ONE_POSITION
CREATE_ABSTRACT_ATTRIBUTE_FOR_ONE_POSITION
CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION
CREATE_NON_RET_ABSTRACT_ATTRIBUTE_FOR_POSITION
#undef CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION
#undef CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION
#undef CREATE_NON_RET_ABSTRACT_ATTRIBUTE_FOR_POSITION
#undef CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION
#undef CREATE_ALL_ABSTRACT_ATTRIBUTE_FOR_POSITION
#undef CREATE_ABSTRACT_ATTRIBUTE_FOR_ONE_POSITION
#undef SWITCH_PK_CREATE
#undef SWITCH_PK_INV