40 #define DEBUG_TYPE "functionattrs"
42 STATISTIC(NumReadNone,
"Number of functions marked readnone");
43 STATISTIC(NumReadOnly,
"Number of functions marked readonly");
44 STATISTIC(NumNoCapture,
"Number of arguments marked nocapture");
45 STATISTIC(NumReturned,
"Number of arguments marked returned");
46 STATISTIC(NumReadNoneArg,
"Number of arguments marked readnone");
47 STATISTIC(NumReadOnlyArg,
"Number of arguments marked readonly");
48 STATISTIC(NumNoAlias,
"Number of function returns marked noalias");
49 STATISTIC(NumNonNullReturn,
"Number of function returns marked nonnull");
50 STATISTIC(NumNoRecurse,
"Number of functions marked as norecurse");
67 const SCCNodeSet &SCCNodes) {
85 bool ReadsMemory =
false;
141 }
else if (
LoadInst *LI = dyn_cast<LoadInst>(I)) {
143 if (!LI->isVolatile()) {
148 }
else if (
StoreInst *
SI = dyn_cast<StoreInst>(I)) {
150 if (!
SI->isVolatile()) {
155 }
else if (
VAArgInst *
VI = dyn_cast<VAArgInst>(I)) {
172 return ReadsMemory ? MAK_ReadOnly : MAK_ReadNone;
176 template <
typename AARGetterT>
177 static bool addReadAttrs(
const SCCNodeSet &SCCNodes, AARGetterT AARGetter) {
180 bool ReadsMemory =
false;
199 bool MadeChange =
false;
201 if (
F->doesNotAccessMemory())
205 if (
F->onlyReadsMemory() && ReadsMemory)
235 struct ArgumentGraphNode {
240 class ArgumentGraph {
243 typedef std::map<Argument *, ArgumentGraphNode> ArgumentMapTy;
245 ArgumentMapTy ArgumentMap;
253 ArgumentGraphNode SyntheticRoot;
256 ArgumentGraph() { SyntheticRoot.Definition =
nullptr; }
260 iterator
begin() {
return SyntheticRoot.Uses.
begin(); }
261 iterator
end() {
return SyntheticRoot.Uses.
end(); }
262 ArgumentGraphNode *getEntryNode() {
return &SyntheticRoot; }
264 ArgumentGraphNode *operator[](
Argument *
A) {
265 ArgumentGraphNode &Node = ArgumentMap[
A];
267 SyntheticRoot.Uses.push_back(&Node);
276 ArgumentUsesTracker(
const SCCNodeSet &SCCNodes)
277 : Captured(
false), SCCNodes(SCCNodes) {}
279 void tooManyUses()
override { Captured =
true; }
281 bool captured(
const Use *U)
override {
283 if (!
CS.getInstruction()) {
299 std::distance(const_cast<const Use *>(
CS.arg_begin()), U);
301 assert(UseIndex <
CS.data_operands_size() &&
302 "Indirect function calls should have been filtered above!");
304 if (UseIndex >=
CS.getNumArgOperands()) {
306 assert(
CS.hasOperandBundles() &&
"Must be!");
317 assert(F->
isVarArg() &&
"More params than args in non-varargs call");
322 Uses.push_back(&*std::next(F->
arg_begin(), UseIndex));
329 const SCCNodeSet &SCCNodes;
339 static ChildIteratorType
child_begin(NodeRef
N) {
return N->Uses.begin(); }
340 static ChildIteratorType
child_end(NodeRef
N) {
return N->Uses.end(); }
372 while (!Worklist.
empty()) {
377 case Instruction::BitCast:
378 case Instruction::GetElementPtr:
379 case Instruction::PHI:
381 case Instruction::AddrSpaceCast:
384 if (Visited.
insert(&UU).second)
389 case Instruction::Invoke: {
390 bool Captures =
true;
395 auto AddUsersToWorklistIfCapturing = [&] {
398 if (Visited.
insert(&UU).second)
404 AddUsersToWorklistIfCapturing();
412 AddUsersToWorklistIfCapturing();
422 unsigned UseIndex = std::distance(CS.
arg_begin(), U);
429 "Data operand use expected!");
433 if (UseIndex >= F->
arg_size() && !IsOperandBundleUse) {
434 assert(F->
isVarArg() &&
"More params than args in non-varargs call");
444 if (IsOperandBundleUse ||
456 AddUsersToWorklistIfCapturing();
469 case Instruction::ICmp:
483 bool Changed =
false;
501 [](
const Argument &Arg) {
return Arg.hasReturnedAttr(); }))
504 auto FindRetArg = [&]() ->
Value * {
505 Value *RetArg =
nullptr;
507 if (
auto *
Ret = dyn_cast<ReturnInst>(BB.getTerminator())) {
510 Value *RetVal =
Ret->getReturnValue()->stripPointerCasts();
511 if (!isa<Argument>(RetVal) || RetVal->
getType() != F->getReturnType())
516 else if (RetArg != RetVal)
523 if (
Value *RetArg = FindRetArg()) {
524 auto *
A = cast<Argument>(RetArg);
525 A->addAttr(AttributeSet::get(F->
getContext(),
A->getArgNo() + 1,
B));
536 bool Changed =
false;
558 if (
A->getType()->isPointerTy() && !
A->hasNoCaptureAttr()) {
559 A->addAttr(AttributeSet::get(F->
getContext(),
A->getArgNo() + 1,
B));
569 if (!
A->getType()->isPointerTy())
571 bool HasNonLocalUses =
false;
572 if (!
A->hasNoCaptureAttr()) {
573 ArgumentUsesTracker Tracker(SCCNodes);
575 if (!Tracker.Captured) {
576 if (Tracker.Uses.empty()) {
579 AttributeSet::get(F->
getContext(),
A->getArgNo() + 1,
B));
586 ArgumentGraphNode *Node = AG[&*
A];
588 Node->Uses.push_back(AG[Use]);
590 HasNonLocalUses =
true;
596 if (!HasNonLocalUses && !
A->onlyReadsMemory()) {
607 A->addAttr(AttributeSet::get(
A->getContext(),
A->getArgNo() + 1,
B));
623 const std::vector<ArgumentGraphNode *> &ArgumentSCC = *
I;
624 if (ArgumentSCC.size() == 1) {
625 if (!ArgumentSCC[0]->Definition)
629 if (ArgumentSCC[0]->Uses.size() == 1 &&
630 ArgumentSCC[0]->Uses[0] == ArgumentSCC[0]) {
631 Argument *
A = ArgumentSCC[0]->Definition;
639 bool SCCCaptured =
false;
640 for (
auto I = ArgumentSCC.begin(),
E = ArgumentSCC.end();
641 I !=
E && !SCCCaptured; ++
I) {
642 ArgumentGraphNode *Node = *
I;
643 if (Node->Uses.empty()) {
644 if (!Node->Definition->hasNoCaptureAttr())
654 for (ArgumentGraphNode *
I : ArgumentSCC) {
655 ArgumentSCCNodes.
insert(
I->Definition);
658 for (
auto I = ArgumentSCC.begin(),
E = ArgumentSCC.end();
659 I !=
E && !SCCCaptured; ++
I) {
660 ArgumentGraphNode *
N = *
I;
661 for (ArgumentGraphNode *
Use : N->Uses) {
672 for (
unsigned i = 0, e = ArgumentSCC.size();
i != e; ++
i) {
691 for (
unsigned i = 0, e = ArgumentSCC.size();
i != e; ++
i) {
694 if (K == Attribute::ReadNone)
708 for (
unsigned i = 0, e = ArgumentSCC.size();
i != e; ++
i) {
729 if (
ReturnInst *
Ret = dyn_cast<ReturnInst>(BB.getTerminator()))
730 FlowsToReturn.
insert(
Ret->getReturnValue());
732 for (
unsigned i = 0;
i != FlowsToReturn.
size(); ++
i) {
733 Value *RetVal = FlowsToReturn[
i];
735 if (
Constant *
C = dyn_cast<Constant>(RetVal)) {
736 if (!
C->isNullValue() && !isa<UndefValue>(
C))
742 if (isa<Argument>(RetVal))
745 if (
Instruction *RVI = dyn_cast<Instruction>(RetVal))
746 switch (RVI->getOpcode()) {
748 case Instruction::BitCast:
749 case Instruction::GetElementPtr:
750 case Instruction::AddrSpaceCast:
751 FlowsToReturn.
insert(RVI->getOperand(0));
759 case Instruction::PHI: {
760 PHINode *PN = cast<PHINode>(RVI);
762 FlowsToReturn.
insert(IncValue);
767 case Instruction::Alloca:
770 case Instruction::Invoke: {
813 bool MadeChange =
false;
836 "nonnull only meaningful on pointer types");
841 if (
auto *
Ret = dyn_cast<ReturnInst>(BB.getTerminator()))
842 FlowsToReturn.
insert(
Ret->getReturnValue());
844 for (
unsigned i = 0;
i != FlowsToReturn.
size(); ++
i) {
845 Value *RetVal = FlowsToReturn[
i];
858 case Instruction::BitCast:
859 case Instruction::GetElementPtr:
860 case Instruction::AddrSpaceCast:
869 case Instruction::PHI: {
870 PHINode *PN = cast<PHINode>(RVI);
876 case Instruction::Invoke: {
881 if (Callee && SCCNodes.count(Callee)) {
900 bool SCCReturnsNonNull =
true;
902 bool MadeChange =
false;
923 bool Speculative =
false;
937 SCCReturnsNonNull =
false;
940 if (SCCReturnsNonNull) {
943 Attribute::NonNull) ||
964 bool HasConvergentFn =
false;
967 HasConvergentFn =
true;
984 if (!HasConvergentFn)
return false;
1012 if (SCCNodes.size() != 1)
1024 Function *Callee = CS.getCalledFunction();
1052 SCCNodeSet SCCNodes;
1053 bool HasUnknownCall =
false;
1059 HasUnknownCall =
true;
1066 if (!HasUnknownCall)
1069 if (!CS.getCalledFunction()) {
1070 HasUnknownCall =
true;
1074 SCCNodes.insert(&F);
1077 bool Changed =
false;
1084 if (!HasUnknownCall) {
1115 "Deduce function attributes",
false,
false)
1122 return new PostOrderFunctionAttrsLegacyPass();
1125 template <
typename AARGetterT>
1127 bool Changed =
false;
1133 SCCNodeSet SCCNodes;
1134 bool ExternalNode =
false;
1140 ExternalNode =
true;
1153 if (!ExternalNode) {
1163 bool PostOrderFunctionAttrsLegacyPass::runOnSCC(
CallGraphSCC &SCC) {
1178 return runImpl(SCC, AARGetter);
1182 struct ReversePostOrderFunctionAttrsLegacyPass :
public ModulePass {
1184 ReversePostOrderFunctionAttrsLegacyPass() :
ModulePass(
ID) {
1189 bool runOnModule(
Module &M)
override;
1201 "Deduce function attributes in RPO",
false,
false)
1207 return new ReversePostOrderFunctionAttrsLegacyPass();
1216 "This function has already been deduced as norecurs!");
1218 "Can only do top-down deduction for internal linkage functions!");
1228 for (
auto *U : F.
users()) {
1252 Function *F =
I->front()->getFunction();
1258 bool Changed =
false;
1259 for (
auto *F :
reverse(Worklist))
1265 bool ReversePostOrderFunctionAttrsLegacyPass::runOnModule(
Module &M) {
1269 auto &CG = getAnalysis<CallGraphWrapperPass>().getCallGraph();
bool hasNoCaptureAttr() const
Return true if this argument has the nocapture attribute on it in its containing function.
Pass interface - Implemented by all 'passes'.
static ChildIteratorType nodes_end(ArgumentGraph *AG)
Return a value (possibly void), from a function.
void push_back(const T &Elt)
This builds on the llvm/ADT/GraphTraits.h file to find the strongly connected components (SCCs) of a ...
const_iterator end(StringRef path)
Get end iterator over path.
iterator_range< use_iterator > uses()
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
LLVM Argument representation.
bool isConvergent() const
Determine if the call is convergent.
This callback is used in conjunction with PointerMayBeCaptured.
STATISTIC(NumFunctions,"Total number of functions")
bool doesNotCapture(unsigned OpNo) const
Determine whether this data operand is not captured.
BasicAAResult createLegacyPMBasicAAResult(Pass &P, Function &F)
A helper for the legacy pass manager to create a BasicAAResult object populated to the best of our ab...
bool onlyReadsMemory() const
Determine if the function does not access or only reads memory.
static bool isFunctionMallocLike(Function *F, const SCCNodeSet &SCCNodes)
Tests whether a function is "malloc-like".
A Module instance is used to store all the information related to an LLVM module. ...
static bool addArgumentReturnedAttrs(const SCCNodeSet &SCCNodes)
Deduce returned attributes for the SCC.
static bool setDoesNotRecurse(Function &F)
BBTy * getParent() const
Get the basic block containing the call site.
bool isConvergent() const
Determine if the call is convergent.
size_type count(PtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
An immutable pass that tracks lazily created AssumptionCache objects.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
bool hasExactDefinition() const
Return true if this global has an exact defintion.
bool onlyReadsMemory(ImmutableCallSite CS)
Checks if the specified call is known to only read from non-volatile memory (or not access memory at ...
bool onlyReadsMemory() const
Determine if the call does not access or only reads memory.
bool isPtrOrPtrVectorTy() const
Return true if this is a pointer type or a vector of pointer types.
const_iterator begin(StringRef path)
Get begin iterator over path.
Type * getReturnType() const
Returns the type of the ret val.
const Function * getParent() const
Return the enclosing method, or null if none.
The two locations do not alias at all.
An instruction for reading from memory.
AttrBuilder & addAttribute(Attribute::AttrKind Val)
Add an attribute to the builder.
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
SmallVectorImpl< ArgumentGraphNode * >::iterator ChildIteratorType
A proxy from a FunctionAnalysisManager to an SCC.
A node in the call graph for a module.
void getAnalysisUsage(AnalysisUsage &Info) const override
getAnalysisUsage - For this class, we declare that we require and preserve the call graph...
size_type size() const
Determine the number of elements in the SetVector.
The access modifies the value stored in memory.
Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager...
bool doesNotAlias(unsigned n) const
Determine if the parameter or return value is marked with NoAlias attribute.
void initializeReversePostOrderFunctionAttrsLegacyPassPass(PassRegistry &)
StringRef getName() const
Return a constant reference to the value's name.
void addAttr(AttributeSet AS)
Add a Attribute to an argument.
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
static bool addNonNullAttrs(const SCCNodeSet &SCCNodes)
Deduce nonnull attributes for the SCC.
inst_iterator inst_begin(Function *F)
bool doesNotThrow() const
Determine if the function cannot unwind.
This class represents the LLVM 'select' instruction.
A Use represents the edge between a Value definition and its users.
bool hasInternalLinkage() const
static ChildIteratorType child_end(NodeRef N)
static bool runImpl(CallGraphSCC &SCC, AARGetterT AARGetter)
No attributes have been set.
The access references the value stored in memory.
AAResults createLegacyPMAAResults(Pass &P, Function &F, BasicAAResult &BAR)
A helper for the legacy pass manager to create a AAResults object populated to the best of our abilit...
void removeAttr(AttributeSet AS)
Remove a Attribute from an argument.
LLVM_NODISCARD bool empty() const
scc_iterator< T > scc_begin(const T &G)
Construct the begin iterator for a deduced graph type T.
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
This file provides interfaces used to build and manipulate a call graph, which is a very useful tool ...
bool insert(const value_type &X)
Insert a new element into the SetVector.
bool mayReadFromMemory() const
Return true if this instruction may read memory.
FunctionModRefBehavior
Summary of how a function affects memory in the program.
A lazily constructed view of the call graph of a module.
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
An instruction for storing to memory.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
unsigned getNumIncomingValues() const
Return the number of incoming edges.
bool hasOperandBundles() const
static MemoryAccessKind checkFunctionMemoryAccess(Function &F, AAResults &AAR, const SCCNodeSet &SCCNodes)
bool pointsToConstantMemory(const MemoryLocation &Loc, bool OrLocal=false)
Checks whether the given location points to constant memory, or if OrLocal is true whether it points ...
static MemoryLocation get(const LoadInst *LI)
Return a location with information about the memory reference by the given instruction.
friend const_iterator end(StringRef path)
Get end iterator over path.
static bool addReadAttrs(const SCCNodeSet &SCCNodes, AARGetterT AARGetter)
Deduce readonly/readnone attributes for the SCC.
A set of analyses that are preserved following a run of a transformation pass.
The ModulePass which wraps up a CallGraph and the logic to build it.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs...ExtraArgs)
Get the result of an analysis pass for a given IR unit.
LLVM Basic Block Representation.
This is an important base class in LLVM.
bool hasInAllocaAttr() const
Return true if this argument has the inalloca attribute on it in its containing function.
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
A manager for alias analyses.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
void setDoesNotAlias(unsigned n)
FunctionModRefBehavior getModRefBehavior(ImmutableCallSite CS)
Return the behavior of the given call site.
Represent the analysis usage information of a pass.
void addAttribute(unsigned i, Attribute::AttrKind Kind)
adds the attribute to the list of attributes.
static bool addNoRecurseAttrs(const SCCNodeSet &SCCNodes)
bool any_of(R &&Range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly...
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE,"Assign register bank of generic virtual registers", false, false) RegBankSelect
static bool addNoRecurseAttrsTopDown(Function &F)
bool doesNotRecurse() const
Determine if the function is known not to recurse, directly or indirectly.
Value * getOperand(unsigned i) const
A node in the call graph.
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
Pass * createReversePostOrderFunctionAttrsPass()
createReversePostOrderFunctionAttrsPass - This pass walks SCCs of the call graph in RPO to deduce and...
bool isPointerTy() const
True if this is an instance of PointerType.
This class represents the va_arg llvm instruction, which returns an argument of the specified type gi...
Pass * createPostOrderFunctionAttrsLegacyPass()
Create a legacy pass manager instance of a pass to compute function attrs in post-order.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
bool PointerMayBeCaptured(const Value *V, bool ReturnCaptures, bool StoreCaptures)
PointerMayBeCaptured - Return true if this pointer value may be captured by the enclosing function (w...
LLVMContext & getContext() const
All values hold a context through their type.
const Value * getTrueValue() const
void getAAResultsAnalysisUsage(AnalysisUsage &AU)
A helper for the legacy pass manager to populate AU to add uses to make sure the analyses required by...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This function does not perform any non-local loads or stores to memory.
User::op_iterator arg_iterator
arg_iterator - The type of iterator to use when looping over actual arguments at this call site...
bool mayWriteToMemory() const
Return true if this instruction may modify memory.
bool doesNotAccessMemory() const
Determine if the call does not access memory.
Representation for a specific memory location.
ArgumentGraphNode * NodeRef
A SetVector that performs no allocations if smaller than a certain size.
Iterator for intrusive lists based on ilist_node.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
Value * getIncomingValue(unsigned i) const
Return incoming value number x.
friend const_iterator begin(StringRef path)
Get begin iterator over path.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
static NodeRef getEntryNode(ArgumentGraph *AG)
Type * getType() const
All values are typed, get the type of this value.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
LLVM_NODISCARD T pop_back_val()
void invalidate(IRUnitT &IR)
Invalidate a specific analysis pass for an IR module.
void setPreservesCFG()
This function should be called by the pass, iff they do not:
unsigned data_operands_size() const
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
AttributeSet getAttributes() const
Return the attribute list for this Function.
unsigned getNumArgOperands() const
static ChildIteratorType child_begin(NodeRef N)
iterator_range< user_iterator > users()
static bool addNoAliasAttrs(const SCCNodeSet &SCCNodes)
Deduce noalias attributes for the SCC.
static bool addArgumentAttrs(const SCCNodeSet &SCCNodes)
Deduce nocapture attributes for the SCC.
static bool removeConvergentAttrs(const SCCNodeSet &SCCNodes)
Remove the convergent attribute from all functions in the SCC if every callsite within the SCC is not...
An analysis pass to compute the CallGraph for a Module.
static bool onlyAccessesArgPointees(FunctionModRefBehavior MRB)
Checks if functions with the specified behavior are known to read and write at most from objects poin...
The basic data container for the call graph of a Module of IR.
bool isKnownNonNull(const Value *V)
Return true if this pointer couldn't possibly be null by its definition.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
void initializePostOrderFunctionAttrsLegacyPassPass(PassRegistry &)
void getAAMetadata(AAMDNodes &N, bool Merge=false) const
Fills the AAMDNodes structure with AA metadata from this instruction.
The access both references and modifies the value stored in memory.
static NodeRef getEntryNode(NodeRef A)
MemoryAccessKind
The three kinds of memory access relevant to 'readonly' and 'readnone' attributes.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
bool paramHasAttr(unsigned i, Attribute::AttrKind Kind) const
Return true if the call or the callee has the given attribute.
Deduce function attributes
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
void preserve()
Mark an analysis as preserved.
Provides passes for computing function attributes based on interprocedural analyses.
static bool isReturnNonNull(Function *F, const SCCNodeSet &SCCNodes, bool &Speculative)
Tests whether this function is known to not return null.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
INITIALIZE_PASS_BEGIN(PostOrderFunctionAttrsLegacyPass,"functionattrs","Deduce function attributes", false, false) INITIALIZE_PASS_END(PostOrderFunctionAttrsLegacyPass
FunTy * getCalledFunction() const
getCalledFunction - Return the function being called if this is a direct call, otherwise return null ...
LLVM Value Representation.
An SCC of the call graph.
CallGraphSCC - This is a single SCC that a CallGraphSCCPass is run on.
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
rpo Deduce function attributes in RPO
unsigned getArgNo() const
Return the index of this formal argument in its containing function.
static ChildIteratorType nodes_begin(ArgumentGraph *AG)
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
print Print MemDeps of function
const Value * getFalseValue() const
This is the interface for LLVM's primary stateless and local alias analysis.
inst_range instructions(Function *F)
inst_iterator inst_end(Function *F)
A container for analyses that lazily runs them and caches their results.
static bool isVolatile(Instruction *Inst)
void emplace(ArgTypes &&...Args)
Create a new object by constructing it in place with the given arguments.
op_range incoming_values()
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
bool isVarArg() const
isVarArg - Return true if this function takes a variable number of arguments.
static Attribute::AttrKind determinePointerReadAttrs(Argument *A, const SmallPtrSet< Argument *, 8 > &SCCNodes)
Returns Attribute::None, Attribute::ReadOnly or Attribute::ReadNone.
static bool deduceFunctionAttributeInRPO(Module &M, CallGraph &CG)
iterator_range< arg_iterator > args()
Enumerate the SCCs of a directed graph in reverse topological order of the SCC DAG.
bool isVoidTy() const
Return true if this is 'void'.
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results...