LLVM  10.0.0
Classes | Namespaces | Macros | Functions | Variables
Attributor.cpp File Reference
#include "llvm/Transforms/IPO/Attributor.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/CaptureTracking.h"
#include "llvm/Analysis/EHPersonalities.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/Analysis/LazyValueInfo.h"
#include "llvm/Analysis/Loads.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Verifier.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
#include <cassert>
Include dependency graph for Attributor.cpp:

Go to the source code of this file.

Classes

struct  AAValueConstantRangeImpl
 ---------------— Value Constant Range Attribute ----------------------— More...
 
struct  AAValueConstantRangeArgument
 
struct  AAValueConstantRangeReturned
 
struct  AAValueConstantRangeFloating
 
struct  AAValueConstantRangeFunction
 
struct  AAValueConstantRangeCallSite
 
struct  AAValueConstantRangeCallSiteReturned
 
struct  AAValueConstantRangeCallSiteArgument
 

Namespaces

 llvm
 This class represents lattice values for constants.
 

Macros

#define DEBUG_TYPE   "attributor"
 
#define BUILD_STAT_MSG_IR_ATTR(TYPE, NAME)   ("Number of " #TYPE " marked '" #NAME "'")
 
#define BUILD_STAT_NAME(NAME, TYPE)   NumIR##TYPE##_##NAME
 
#define STATS_DECL_(NAME, MSG)   STATISTIC(NAME, MSG);
 
#define STATS_DECL(NAME, TYPE, MSG)   STATS_DECL_(BUILD_STAT_NAME(NAME, TYPE), MSG);
 
#define STATS_TRACK(NAME, TYPE)   ++(BUILD_STAT_NAME(NAME, TYPE));
 
#define STATS_DECLTRACK(NAME, TYPE, MSG)
 
#define STATS_DECLTRACK_ARG_ATTR(NAME)   STATS_DECLTRACK(NAME, Arguments, BUILD_STAT_MSG_IR_ATTR(arguments, NAME))
 
#define STATS_DECLTRACK_CSARG_ATTR(NAME)
 
#define STATS_DECLTRACK_FN_ATTR(NAME)   STATS_DECLTRACK(NAME, Function, BUILD_STAT_MSG_IR_ATTR(functions, NAME))
 
#define STATS_DECLTRACK_CS_ATTR(NAME)   STATS_DECLTRACK(NAME, CS, BUILD_STAT_MSG_IR_ATTR(call site, NAME))
 
#define STATS_DECLTRACK_FNRET_ATTR(NAME)
 
#define STATS_DECLTRACK_CSRET_ATTR(NAME)
 
#define STATS_DECLTRACK_FLOATING_ATTR(NAME)
 
#define PIPE_OPERATOR(CLASS)
 
#define SWITCH_PK_INV(CLASS, PK, POS_NAME)
 
#define SWITCH_PK_CREATE(CLASS, IRP, PK, SUFFIX)
 
#define CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION(CLASS)
 
#define CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION(CLASS)
 
#define CREATE_ALL_ABSTRACT_ATTRIBUTE_FOR_POSITION(CLASS)
 
#define CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION(CLASS)
 
#define CREATE_NON_RET_ABSTRACT_ATTRIBUTE_FOR_POSITION(CLASS)
 

Functions

 STATISTIC (NumFnWithExactDefinition, "Number of function with exact definitions")
 
 STATISTIC (NumFnWithoutExactDefinition, "Number of function without exact definitions")
 
 STATISTIC (NumAttributesTimedOut, "Number of abstract attributes timed out before fixpoint")
 
 STATISTIC (NumAttributesValidFixpoint, "Number of abstract attributes in a valid fixpoint state")
 
 STATISTIC (NumAttributesManifested, "Number of abstract attributes manifested in IR")
 
 STATISTIC (NumAttributesFixedDueToRequiredDependences, "Number of abstract attributes fixed due to required dependences")
 
static void replaceAllInstructionUsesWith (Value &Old, Value &New)
 For calls (and invokes) we will only replace instruction uses to not disturb the old style call graph. More...
 
template<typename AAType , typename StateTy >
static bool genericValueTraversal (Attributor &A, IRPosition IRP, const AAType &QueryingAA, StateTy &State, const function_ref< bool(Value &, StateTy &, bool)> &VisitValueCB, int MaxValues=8)
 Recursively visit all values that might become IRP at some point. More...
 
static bool isEqualOrWorse (const Attribute &New, const Attribute &Old)
 Return true if New is equal or worse than Old. More...
 
static bool addIfNotExistent (LLVMContext &Ctx, const Attribute &Attr, AttributeList &Attrs, int AttrIdx)
 Return true if the information provided by Attr was added to the attribute list Attrs. More...
 
static const Value * getBasePointerOfAccessPointerOperand (const Instruction *I, int64_t &BytesOffset, const DataLayout &DL, bool AllowNonInbounds=false)
 
static bool checkForAllInstructionsImpl (InformationCache::OpcodeInstMapTy &OpcodeInstMap, const function_ref< bool(Instruction &)> &Pred, const AAIsDead *LivenessAA, bool &AnyDead, const ArrayRef< unsigned > &Opcodes)
 
static bool runAttributorOnModule (Module &M, AnalysisGetter &AG)
 } More...
 
 INITIALIZE_PASS_BEGIN (AttributorLegacyPass, "attributor", "Deduce and propagate attributes", false, false) INITIALIZE_PASS_END(AttributorLegacyPass
 

Variables

static cl::opt< unsigned > MaxFixpointIterations ("attributor-max-iterations", cl::Hidden, cl::desc("Maximal number of fixpoint iterations."), cl::init(32))
 
static cl::opt< bool > VerifyMaxFixpointIterations ("attributor-max-iterations-verify", cl::Hidden, cl::desc("Verify that max-iterations is a tight bound for a fixpoint"), cl::init(false))
 
static cl::opt< bool > DisableAttributor ("attributor-disable", cl::Hidden, cl::desc("Disable the attributor inter-procedural deduction pass."), cl::init(true))
 
static cl::opt< bool > AnnotateDeclarationCallSites ("attributor-annotate-decl-cs", cl::Hidden, cl::desc("Annotate call sites of function declarations."), cl::init(false))
 
static cl::opt< bool > ManifestInternal ("attributor-manifest-internal", cl::Hidden, cl::desc("Manifest Attributor internal string attributes."), cl::init(false))
 
static cl::opt< unsigned > DepRecInterval ("attributor-dependence-recompute-interval", cl::Hidden, cl::desc("Number of iterations until dependences are recomputed."), cl::init(4))
 
static cl::opt< bool > EnableHeapToStack ("enable-heap-to-stack-conversion", cl::init(true), cl::Hidden)
 
static cl::opt< int > MaxHeapToStackSize ("max-heap-to-stack-size", cl::init(128), cl::Hidden)
 
 attributor
 
Deduce and propagate attributes
 
Deduce and propagate false
 

Macro Definition Documentation

◆ BUILD_STAT_MSG_IR_ATTR

#define BUILD_STAT_MSG_IR_ATTR (   TYPE,
  NAME 
)    ("Number of " #TYPE " marked '" #NAME "'")

Definition at line 76 of file Attributor.cpp.

◆ BUILD_STAT_NAME

#define BUILD_STAT_NAME (   NAME,
  TYPE 
)    NumIR##TYPE##_##NAME

Definition at line 78 of file Attributor.cpp.

Referenced by llvm::IRPosition::getAttrs(), and llvm::Attributor::run().

◆ CREATE_ALL_ABSTRACT_ATTRIBUTE_FOR_POSITION

#define CREATE_ALL_ABSTRACT_ATTRIBUTE_FOR_POSITION (   CLASS)
Value:
CLASS &CLASS::createForPosition(const IRPosition &IRP, Attributor &A) { \
CLASS *AA = nullptr; \
switch (IRP.getPositionKind()) { \
SWITCH_PK_INV(CLASS, IRP_INVALID, "invalid") \
SWITCH_PK_CREATE(CLASS, IRP, IRP_FUNCTION, Function) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE, CallSite) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_FLOAT, Floating) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_ARGUMENT, Argument) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_RETURNED, Returned) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE_RETURNED, CallSiteReturned) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE_ARGUMENT, CallSiteArgument) \
} \
return *AA; \
}
This class represents an incoming formal argument to a Function.
Definition: Argument.h:29
The fixpoint analysis framework that orchestrates the attribute deduction.
Definition: Attributor.h:685
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Kind getPositionKind() const
Return the associated position kind.
Definition: Attributor.h:360

Definition at line 6886 of file Attributor.cpp.

◆ CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION

#define CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION (   CLASS)
Value:
CLASS &CLASS::createForPosition(const IRPosition &IRP, Attributor &A) { \
CLASS *AA = nullptr; \
switch (IRP.getPositionKind()) { \
SWITCH_PK_INV(CLASS, IRP_INVALID, "invalid") \
SWITCH_PK_INV(CLASS, IRP_FLOAT, "floating") \
SWITCH_PK_INV(CLASS, IRP_ARGUMENT, "argument") \
SWITCH_PK_INV(CLASS, IRP_RETURNED, "returned") \
SWITCH_PK_INV(CLASS, IRP_CALL_SITE_RETURNED, "call site returned") \
SWITCH_PK_INV(CLASS, IRP_CALL_SITE_ARGUMENT, "call site argument") \
SWITCH_PK_CREATE(CLASS, IRP, IRP_FUNCTION, Function) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE, CallSite) \
} \
return *AA; \
}
The fixpoint analysis framework that orchestrates the attribute deduction.
Definition: Attributor.h:685
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Kind getPositionKind() const
Return the associated position kind.
Definition: Attributor.h:360

Definition at line 6854 of file Attributor.cpp.

◆ CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION

#define CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION (   CLASS)
Value:
CLASS &CLASS::createForPosition(const IRPosition &IRP, Attributor &A) { \
CLASS *AA = nullptr; \
switch (IRP.getPositionKind()) { \
SWITCH_PK_INV(CLASS, IRP_INVALID, "invalid") \
SWITCH_PK_INV(CLASS, IRP_ARGUMENT, "argument") \
SWITCH_PK_INV(CLASS, IRP_FLOAT, "floating") \
SWITCH_PK_INV(CLASS, IRP_RETURNED, "returned") \
SWITCH_PK_INV(CLASS, IRP_CALL_SITE_RETURNED, "call site returned") \
SWITCH_PK_INV(CLASS, IRP_CALL_SITE_ARGUMENT, "call site argument") \
SWITCH_PK_INV(CLASS, IRP_CALL_SITE, "call site") \
SWITCH_PK_CREATE(CLASS, IRP, IRP_FUNCTION, Function) \
} \
return *AA; \
}
The fixpoint analysis framework that orchestrates the attribute deduction.
Definition: Attributor.h:685
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Kind getPositionKind() const
Return the associated position kind.
Definition: Attributor.h:360

Definition at line 6902 of file Attributor.cpp.

◆ CREATE_NON_RET_ABSTRACT_ATTRIBUTE_FOR_POSITION

#define CREATE_NON_RET_ABSTRACT_ATTRIBUTE_FOR_POSITION (   CLASS)
Value:
CLASS &CLASS::createForPosition(const IRPosition &IRP, Attributor &A) { \
CLASS *AA = nullptr; \
switch (IRP.getPositionKind()) { \
SWITCH_PK_INV(CLASS, IRP_INVALID, "invalid") \
SWITCH_PK_INV(CLASS, IRP_RETURNED, "returned") \
SWITCH_PK_CREATE(CLASS, IRP, IRP_FUNCTION, Function) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE, CallSite) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_FLOAT, Floating) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_ARGUMENT, Argument) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE_RETURNED, CallSiteReturned) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE_ARGUMENT, CallSiteArgument) \
} \
return *AA; \
}
This class represents an incoming formal argument to a Function.
Definition: Argument.h:29
The fixpoint analysis framework that orchestrates the attribute deduction.
Definition: Attributor.h:685
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Kind getPositionKind() const
Return the associated position kind.
Definition: Attributor.h:360

Definition at line 6918 of file Attributor.cpp.

◆ CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION

#define CREATE_VALUE_ABSTRACT_ATTRIBUTE_FOR_POSITION (   CLASS)
Value:
CLASS &CLASS::createForPosition(const IRPosition &IRP, Attributor &A) { \
CLASS *AA = nullptr; \
switch (IRP.getPositionKind()) { \
SWITCH_PK_INV(CLASS, IRP_INVALID, "invalid") \
SWITCH_PK_INV(CLASS, IRP_FUNCTION, "function") \
SWITCH_PK_INV(CLASS, IRP_CALL_SITE, "call site") \
SWITCH_PK_CREATE(CLASS, IRP, IRP_FLOAT, Floating) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_ARGUMENT, Argument) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_RETURNED, Returned) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE_RETURNED, CallSiteReturned) \
SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE_ARGUMENT, CallSiteArgument) \
} \
return *AA; \
}
This class represents an incoming formal argument to a Function.
Definition: Argument.h:29
The fixpoint analysis framework that orchestrates the attribute deduction.
Definition: Attributor.h:685
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Kind getPositionKind() const
Return the associated position kind.
Definition: Attributor.h:360

Definition at line 6870 of file Attributor.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "attributor"

Definition at line 48 of file Attributor.cpp.

◆ PIPE_OPERATOR

#define PIPE_OPERATOR (   CLASS)
Value:
raw_ostream &operator<<(raw_ostream &OS, const CLASS &AA) { \
return OS << static_cast<const AbstractAttribute &>(AA); \
}
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
Definition: APInt.h:2096
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46

Definition at line 110 of file Attributor.cpp.

◆ STATS_DECL

#define STATS_DECL (   NAME,
  TYPE,
  MSG 
)    STATS_DECL_(BUILD_STAT_NAME(NAME, TYPE), MSG);

Definition at line 80 of file Attributor.cpp.

Referenced by llvm::IRPosition::getAttrs(), and llvm::Attributor::run().

◆ STATS_DECL_

#define STATS_DECL_ (   NAME,
  MSG 
)    STATISTIC(NAME, MSG);

Definition at line 79 of file Attributor.cpp.

◆ STATS_DECLTRACK

#define STATS_DECLTRACK (   NAME,
  TYPE,
  MSG 
)
Value:
{ \
STATS_DECL(NAME, TYPE, MSG) \
STATS_TRACK(NAME, TYPE) \
}

Definition at line 83 of file Attributor.cpp.

Referenced by llvm::IRPosition::getAttrs().

◆ STATS_DECLTRACK_ARG_ATTR

#define STATS_DECLTRACK_ARG_ATTR (   NAME)    STATS_DECLTRACK(NAME, Arguments, BUILD_STAT_MSG_IR_ATTR(arguments, NAME))

◆ STATS_DECLTRACK_CS_ATTR

#define STATS_DECLTRACK_CS_ATTR (   NAME)    STATS_DECLTRACK(NAME, CS, BUILD_STAT_MSG_IR_ATTR(call site, NAME))

◆ STATS_DECLTRACK_CSARG_ATTR

#define STATS_DECLTRACK_CSARG_ATTR (   NAME)
Value:
STATS_DECLTRACK(NAME, CSArguments, \
BUILD_STAT_MSG_IR_ATTR(call site arguments, NAME))
#define BUILD_STAT_MSG_IR_ATTR(TYPE, NAME)
Definition: Attributor.cpp:76
#define STATS_DECLTRACK(NAME, TYPE, MSG)
Definition: Attributor.cpp:83

Definition at line 90 of file Attributor.cpp.

Referenced by llvm::IRPosition::getAttrs(), and AAValueConstantRangeCallSiteArgument::trackStatistics().

◆ STATS_DECLTRACK_CSRET_ATTR

#define STATS_DECLTRACK_CSRET_ATTR (   NAME)
Value:
STATS_DECLTRACK(NAME, CSReturn, \
BUILD_STAT_MSG_IR_ATTR(call site returns, NAME))
#define BUILD_STAT_MSG_IR_ATTR(TYPE, NAME)
Definition: Attributor.cpp:76
#define STATS_DECLTRACK(NAME, TYPE, MSG)
Definition: Attributor.cpp:83

Definition at line 100 of file Attributor.cpp.

Referenced by llvm::IRPosition::getAttrs(), and AAValueConstantRangeCallSiteReturned::trackStatistics().

◆ STATS_DECLTRACK_FLOATING_ATTR

#define STATS_DECLTRACK_FLOATING_ATTR (   NAME)
Value:
STATS_DECLTRACK(NAME, Floating, \
("Number of floating values known to be '" #NAME "'"))
#define STATS_DECLTRACK(NAME, TYPE, MSG)
Definition: Attributor.cpp:83

Definition at line 103 of file Attributor.cpp.

Referenced by llvm::IRPosition::getAttrs(), and AAValueConstantRangeFloating::trackStatistics().

◆ STATS_DECLTRACK_FN_ATTR

#define STATS_DECLTRACK_FN_ATTR (   NAME)    STATS_DECLTRACK(NAME, Function, BUILD_STAT_MSG_IR_ATTR(functions, NAME))

◆ STATS_DECLTRACK_FNRET_ATTR

#define STATS_DECLTRACK_FNRET_ATTR (   NAME)
Value:
STATS_DECLTRACK(NAME, FunctionReturn, \
BUILD_STAT_MSG_IR_ATTR(function returns, NAME))
#define BUILD_STAT_MSG_IR_ATTR(TYPE, NAME)
Definition: Attributor.cpp:76
#define STATS_DECLTRACK(NAME, TYPE, MSG)
Definition: Attributor.cpp:83

Definition at line 97 of file Attributor.cpp.

Referenced by llvm::IRPosition::getAttrs(), and AAValueConstantRangeReturned::trackStatistics().

◆ STATS_TRACK

#define STATS_TRACK (   NAME,
  TYPE 
)    ++(BUILD_STAT_NAME(NAME, TYPE));

Definition at line 82 of file Attributor.cpp.

◆ SWITCH_PK_CREATE

#define SWITCH_PK_CREATE (   CLASS,
  IRP,
  PK,
  SUFFIX 
)
Value:
case IRPosition::PK: \
AA = new CLASS##SUFFIX(IRP); \
break;

Definition at line 6849 of file Attributor.cpp.

◆ SWITCH_PK_INV

#define SWITCH_PK_INV (   CLASS,
  PK,
  POS_NAME 
)
Value:
case IRPosition::PK: \
llvm_unreachable("Cannot create " #CLASS " for a " POS_NAME " position!");

Definition at line 6845 of file Attributor.cpp.

Function Documentation

◆ addIfNotExistent()

static bool addIfNotExistent ( LLVMContext &  Ctx,
const Attribute &  Attr,
AttributeList &  Attrs,
int  AttrIdx 
)
static

Return true if the information provided by Attr was added to the attribute list Attrs.

This is only the case if it was not already present in Attrs at the position describe by PK and AttrIdx.

Definition at line 362 of file Attributor.cpp.

References llvm::AttributeList::addAttribute(), llvm::AttributeList::getAttribute(), llvm::Attribute::getKindAsEnum(), llvm::Attribute::getKindAsString(), llvm::AttributeList::hasAttribute(), llvm::Attribute::isEnumAttribute(), isEqualOrWorse(), llvm::Attribute::isIntAttribute(), llvm::Attribute::isStringAttribute(), llvm_unreachable, and llvm::AttributeList::removeAttribute().

Referenced by llvm::IRAttributeManifest::manifestAttrs().

◆ checkForAllInstructionsImpl()

static bool checkForAllInstructionsImpl ( InformationCache::OpcodeInstMapTy &  OpcodeInstMap,
const function_ref< bool(Instruction &)> &  Pred,
const AAIsDead *  LivenessAA,
bool &  AnyDead,
const ArrayRef< unsigned > &  Opcodes 
)
static

◆ genericValueTraversal()

template<typename AAType , typename StateTy >
static bool genericValueTraversal ( Attributor &  A,
IRPosition  IRP,
const AAType &  QueryingAA,
StateTy &  State,
const function_ref< bool(Value &, StateTy &, bool)> &  VisitValueCB,
int  MaxValues = 8 
)
static

Recursively visit all values that might become IRP at some point.

This will be done by looking through cast instructions, selects, phis, and calls with the "returned" attribute. Once we cannot look through the value any further, the callback VisitValueCB is invoked and passed the current value, the State, and a flag to indicate if we stripped anything. To limit how much effort is invested, we will never visit more values than specified by MaxValues.

Definition at line 266 of file Attributor.cpp.

References Arg, llvm::Function::args(), assert(), llvm::numbers::e, llvm::SmallVectorBase::empty(), llvm::IRPosition::function(), llvm::Attributor::getAAFor(), llvm::IRPosition::getAnchorScope(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getArgOperand(), llvm::IRPosition::getAssociatedValue(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getCalledFunction(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::AAIsDead::isAssumedDead(), llvm::Type::isPointerTy(), llvm::OPTIONAL, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::Attributor::recordDependence(), SI, and llvm::Value::stripPointerCasts().

◆ getBasePointerOfAccessPointerOperand()

static const Value* getBasePointerOfAccessPointerOperand ( const Instruction *  I,
int64_t &  BytesOffset,
const DataLayout &  DL,
bool  AllowNonInbounds = false 
)
static

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( AttributorLegacyPass  ,
"attributor"  ,
"Deduce and propagate attributes"  ,
false  ,
false   
)

◆ isEqualOrWorse()

static bool isEqualOrWorse ( const Attribute &  New,
const Attribute &  Old 
)
static

Return true if New is equal or worse than Old.

Definition at line 352 of file Attributor.cpp.

References llvm::Attribute::getValueAsInt(), and llvm::Attribute::isIntAttribute().

Referenced by addIfNotExistent().

◆ replaceAllInstructionUsesWith()

static void replaceAllInstructionUsesWith ( Value &  Old,
Value &  New 
)
static

For calls (and invokes) we will only replace instruction uses to not disturb the old style call graph.

TODO: Remove this once we get rid of the old PM.

Definition at line 247 of file Attributor.cpp.

References llvm::SmallVectorTemplateBase< T >::push_back(), llvm::Value::replaceAllUsesWith(), and llvm::Value::uses().

Referenced by llvm::IRPosition::getAttrs().

◆ runAttributorOnModule()

static bool runAttributorOnModule ( Module &  M,
AnalysisGetter &  AG 
)
static

◆ STATISTIC() [1/6]

STATISTIC ( NumFnWithExactDefinition  ,
"Number of function with exact definitions"   
)

◆ STATISTIC() [2/6]

STATISTIC ( NumFnWithoutExactDefinition  ,
"Number of function without exact definitions"   
)

◆ STATISTIC() [3/6]

STATISTIC ( NumAttributesTimedOut  ,
"Number of abstract attributes timed out before fixpoint"   
)

◆ STATISTIC() [4/6]

STATISTIC ( NumAttributesValidFixpoint  ,
"Number of abstract attributes in a valid fixpoint state"   
)

◆ STATISTIC() [5/6]

STATISTIC ( NumAttributesManifested  ,
"Number of abstract attributes manifested in IR"   
)

◆ STATISTIC() [6/6]

STATISTIC ( NumAttributesFixedDueToRequiredDependences  ,
"Number of abstract attributes fixed due to required dependences"   
)

Variable Documentation

◆ AnnotateDeclarationCallSites

cl::opt<bool> AnnotateDeclarationCallSites("attributor-annotate-decl-cs", cl::Hidden, cl::desc("Annotate call sites of function declarations."), cl::init(false))
static

◆ attributes

Deduce and propagate attributes

Definition at line 6969 of file Attributor.cpp.

Referenced by FunctionNumber(), and llvm::LTOModule::getSymbolAttributes().

◆ attributor

attributor

Definition at line 6969 of file Attributor.cpp.

◆ DepRecInterval

cl::opt<unsigned> DepRecInterval("attributor-dependence-recompute-interval", cl::Hidden, cl::desc("Number of iterations until dependences are recomputed."), cl::init(4))
static

Referenced by runAttributorOnModule().

◆ DisableAttributor

cl::opt<bool> DisableAttributor("attributor-disable", cl::Hidden, cl::desc("Disable the attributor inter-procedural deduction pass."), cl::init(true))
static

Referenced by runAttributorOnModule().

◆ EnableHeapToStack

cl::opt<bool> EnableHeapToStack("enable-heap-to-stack-conversion", cl::init(true), cl::Hidden)
static

◆ false

Deduce and propagate false

Definition at line 6969 of file Attributor.cpp.

◆ ManifestInternal

cl::opt<bool> ManifestInternal("attributor-manifest-internal", cl::Hidden, cl::desc("Manifest Attributor internal string attributes."), cl::init(false))
static

◆ MaxFixpointIterations

cl::opt<unsigned> MaxFixpointIterations("attributor-max-iterations", cl::Hidden, cl::desc("Maximal number of fixpoint iterations."), cl::init(32))
static

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

◆ MaxHeapToStackSize

cl::opt<int> MaxHeapToStackSize("max-heap-to-stack-size", cl::init(128), cl::Hidden)
static

◆ VerifyMaxFixpointIterations

cl::opt<bool> VerifyMaxFixpointIterations("attributor-max-iterations-verify", cl::Hidden, cl::desc("Verify that max-iterations is a tight bound for a fixpoint"), cl::init(false))
static

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