LLVM  14.0.0git
Classes | Namespaces | Macros | Functions | Variables
FunctionAttrs.cpp File Reference
#include "llvm/Transforms/IPO/FunctionAttrs.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SCCIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/BasicAliasAnalysis.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/CGSCCPassManager.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/CallGraphSCCPass.h"
#include "llvm/Analysis/CaptureTracking.h"
#include "llvm/Analysis/LazyCallGraph.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Use.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Utils/Local.h"
#include <cassert>
#include <iterator>
#include <map>
#include <vector>

Go to the source code of this file.

Classes

struct  llvm::GraphTraits< ArgumentGraphNode * >
 
struct  llvm::GraphTraits< ArgumentGraph * >
 

Namespaces

 llvm
 This file implements support for optimizing divisions by a constant.
 

Macros

#define DEBUG_TYPE   "function-attrs"
 

Functions

 STATISTIC (NumReadNone, "Number of functions marked readnone")
 
 STATISTIC (NumReadOnly, "Number of functions marked readonly")
 
 STATISTIC (NumWriteOnly, "Number of functions marked writeonly")
 
 STATISTIC (NumNoCapture, "Number of arguments marked nocapture")
 
 STATISTIC (NumReturned, "Number of arguments marked returned")
 
 STATISTIC (NumReadNoneArg, "Number of arguments marked readnone")
 
 STATISTIC (NumReadOnlyArg, "Number of arguments marked readonly")
 
 STATISTIC (NumNoAlias, "Number of function returns marked noalias")
 
 STATISTIC (NumNonNullReturn, "Number of function returns marked nonnull")
 
 STATISTIC (NumNoRecurse, "Number of functions marked as norecurse")
 
 STATISTIC (NumNoUnwind, "Number of functions marked as nounwind")
 
 STATISTIC (NumNoFree, "Number of functions marked as nofree")
 
 STATISTIC (NumWillReturn, "Number of functions marked as willreturn")
 
 STATISTIC (NumNoSync, "Number of functions marked as nosync")
 
 STATISTIC (NumThinLinkNoRecurse, "Number of functions marked as norecurse during thinlink")
 
 STATISTIC (NumThinLinkNoUnwind, "Number of functions marked as nounwind during thinlink")
 
static MemoryAccessKind checkFunctionMemoryAccess (Function &F, bool ThisBody, AAResults &AAR, const SCCNodeSet &SCCNodes)
 Returns the memory access attribute for function F using AAR for AA results, where SCCNodes is the current SCC. More...
 
template<typename AARGetterT >
static bool addReadAttrs (const SCCNodeSet &SCCNodes, AARGetterT &&AARGetter)
 Deduce readonly/readnone attributes for the SCC. More...
 
static FunctionSummarycalculatePrevailingSummary (ValueInfo VI, DenseMap< ValueInfo, FunctionSummary * > &CachedPrevailingSummary, function_ref< bool(GlobalValue::GUID, const GlobalValueSummary *)> IsPrevailing)
 
static Attribute::AttrKind determinePointerReadAttrs (Argument *A, const SmallPtrSet< Argument *, 8 > &SCCNodes)
 Returns Attribute::None, Attribute::ReadOnly or Attribute::ReadNone. More...
 
static bool addArgumentReturnedAttrs (const SCCNodeSet &SCCNodes)
 Deduce returned attributes for the SCC. More...
 
static bool addArgumentAttrsFromCallsites (Function &F)
 If a callsite has arguments that are also arguments to the parent function, try to propagate attributes from the callsite's arguments to the parent's arguments. More...
 
static bool addReadAttr (Argument *A, Attribute::AttrKind R)
 
static bool addArgumentAttrs (const SCCNodeSet &SCCNodes)
 Deduce nocapture attributes for the SCC. More...
 
static bool isFunctionMallocLike (Function *F, const SCCNodeSet &SCCNodes)
 Tests whether a function is "malloc-like". More...
 
static bool addNoAliasAttrs (const SCCNodeSet &SCCNodes)
 Deduce noalias attributes for the SCC. More...
 
static bool isReturnNonNull (Function *F, const SCCNodeSet &SCCNodes, bool &Speculative)
 Tests whether this function is known to not return null. More...
 
static bool addNonNullAttrs (const SCCNodeSet &SCCNodes)
 Deduce nonnull attributes for the SCC. More...
 
static bool InstrBreaksNonConvergent (Instruction &I, const SCCNodeSet &SCCNodes)
 Helper for non-Convergent inference predicate InstrBreaksAttribute. More...
 
static bool InstrBreaksNonThrowing (Instruction &I, const SCCNodeSet &SCCNodes)
 Helper for NoUnwind inference predicate InstrBreaksAttribute. More...
 
static bool InstrBreaksNoFree (Instruction &I, const SCCNodeSet &SCCNodes)
 Helper for NoFree inference predicate InstrBreaksAttribute. More...
 
static bool inferConvergent (const SCCNodeSet &SCCNodes)
 Attempt to remove convergent function attribute when possible. More...
 
static bool inferAttrsFromFunctionBodies (const SCCNodeSet &SCCNodes)
 Infer attributes from all functions in the SCC by scanning every instruction for compliance to the attribute assumptions. More...
 
static bool addNoRecurseAttrs (const SCCNodeSet &SCCNodes)
 
static bool instructionDoesNotReturn (Instruction &I)
 
static bool basicBlockCanReturn (BasicBlock &BB)
 
static bool addNoReturnAttrs (const SCCNodeSet &SCCNodes)
 
static bool functionWillReturn (const Function &F)
 
static bool addWillReturn (const SCCNodeSet &SCCNodes)
 
static bool isOrderedAtomic (Instruction *I)
 
static bool InstrBreaksNoSync (Instruction &I, const SCCNodeSet &SCCNodes)
 
static bool addNoSyncAttr (const SCCNodeSet &SCCNodes)
 
static SCCNodesResult createSCCNodeSet (ArrayRef< Function * > Functions)
 
template<typename AARGetterT >
static bool deriveAttrsInPostOrder (ArrayRef< Function * > Functions, AARGetterT &&AARGetter)
 
 INITIALIZE_PASS_BEGIN (PostOrderFunctionAttrsLegacyPass, "function-attrs", "Deduce function attributes", false, false) INITIALIZE_PASS_END(PostOrderFunctionAttrsLegacyPass
 
template<typename AARGetterT >
static bool runImpl (CallGraphSCC &SCC, AARGetterT AARGetter)
 
 INITIALIZE_PASS_BEGIN (ReversePostOrderFunctionAttrsLegacyPass, "rpo-function-attrs", "Deduce function attributes in RPO", false, false) INITIALIZE_PASS_END(ReversePostOrderFunctionAttrsLegacyPass
 
static bool addNoRecurseAttrsTopDown (Function &F)
 
static bool deduceFunctionAttributeInRPO (Module &M, CallGraph &CG)
 

Variables

static cl::opt< bool > EnableNonnullArgPropagation ("enable-nonnull-arg-prop", cl::init(true), cl::Hidden, cl::desc("Try to propagate nonnull argument attributes from callsites to " "caller functions."))
 
static cl::opt< bool > DisableNoUnwindInference ("disable-nounwind-inference", cl::Hidden, cl::desc("Stop inferring nounwind attribute during function-attrs pass"))
 
static cl::opt< bool > DisableNoFreeInference ("disable-nofree-inference", cl::Hidden, cl::desc("Stop inferring nofree attribute during function-attrs pass"))
 
static cl::opt< bool > DisableThinLTOPropagation ("disable-thinlto-funcattrs", cl::init(true), cl::Hidden, cl::desc("Don't propagate function-attrs in thinLTO"))
 
function attrs
 
function Deduce function attributes
 
function Deduce function false
 
rpo function Deduce function attributes in RPO
 

Detailed Description

This file implements interprocedural passes which walk the call-graph deducing and/or propagating function attributes.

Definition in file FunctionAttrs.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "function-attrs"

Definition at line 69 of file FunctionAttrs.cpp.

Function Documentation

◆ addArgumentAttrs()

static bool addArgumentAttrs ( const SCCNodeSet &  SCCNodes)
static

Deduce nocapture attributes for the SCC.

Definition at line 894 of file FunctionAttrs.cpp.

References A, addArgumentAttrsFromCallsites(), E, F, and llvm::PointerMayBeCaptured().

Referenced by deriveAttrsInPostOrder().

◆ addArgumentAttrsFromCallsites()

static bool addArgumentAttrsFromCallsites ( Function F)
static

If a callsite has arguments that are also arguments to the parent function, try to propagate attributes from the callsite's arguments to the parent's arguments.

This may be important because inlining can cause information loss when attribute knowledge disappears with the inlined call.

Definition at line 835 of file FunctionAttrs.cpp.

References EnableNonnullArgPropagation.

Referenced by addArgumentAttrs().

◆ addArgumentReturnedAttrs()

static bool addArgumentReturnedAttrs ( const SCCNodeSet &  SCCNodes)
static

Deduce returned attributes for the SCC.

Definition at line 782 of file FunctionAttrs.cpp.

References A, llvm::any_of(), Arg, BB, F, llvm::Value::getType(), and llvm::MipsISD::Ret.

Referenced by deriveAttrsInPostOrder().

◆ addNoAliasAttrs()

static bool addNoAliasAttrs ( const SCCNodeSet &  SCCNodes)
static

Deduce noalias attributes for the SCC.

Definition at line 1135 of file FunctionAttrs.cpp.

References F, and isFunctionMallocLike().

Referenced by deriveAttrsInPostOrder().

◆ addNonNullAttrs()

static bool addNonNullAttrs ( const SCCNodeSet &  SCCNodes)
static

Deduce nonnull attributes for the SCC.

Definition at line 1245 of file FunctionAttrs.cpp.

References llvm::dbgs(), F, isReturnNonNull(), and LLVM_DEBUG.

Referenced by deriveAttrsInPostOrder().

◆ addNoRecurseAttrs()

static bool addNoRecurseAttrs ( const SCCNodeSet &  SCCNodes)
static

Definition at line 1565 of file FunctionAttrs.cpp.

References BB, Callee, F, llvm::CallBase::getCalledFunction(), and I.

Referenced by deriveAttrsInPostOrder().

◆ addNoRecurseAttrsTopDown()

static bool addNoRecurseAttrsTopDown ( Function F)
static

◆ addNoReturnAttrs()

static bool addNoReturnAttrs ( const SCCNodeSet &  SCCNodes)
static

Definition at line 1611 of file FunctionAttrs.cpp.

References basicBlockCanReturn(), F, and llvm::none_of().

Referenced by deriveAttrsInPostOrder().

◆ addNoSyncAttr()

static bool addNoSyncAttr ( const SCCNodeSet &  SCCNodes)
static

Definition at line 1731 of file FunctionAttrs.cpp.

References llvm::dbgs(), F, I, InstrBreaksNoSync(), and LLVM_DEBUG.

Referenced by deriveAttrsInPostOrder().

◆ addReadAttr()

static bool addReadAttr ( Argument A,
Attribute::AttrKind  R 
)
static

Definition at line 874 of file FunctionAttrs.cpp.

References A, assert(), and llvm::RISCVFenceField::R.

◆ addReadAttrs()

template<typename AARGetterT >
static bool addReadAttrs ( const SCCNodeSet &  SCCNodes,
AARGetterT &&  AARGetter 
)
static

Deduce readonly/readnone attributes for the SCC.

Definition at line 252 of file FunctionAttrs.cpp.

References llvm::AttrBuilder::addAttribute(), checkFunctionMemoryAccess(), F, llvm::MAK_MayWrite, llvm::MAK_ReadNone, llvm::MAK_ReadOnly, and llvm::MAK_WriteOnly.

Referenced by deriveAttrsInPostOrder().

◆ addWillReturn()

static bool addWillReturn ( const SCCNodeSet &  SCCNodes)
static

Definition at line 1660 of file FunctionAttrs.cpp.

References F, and functionWillReturn().

Referenced by deriveAttrsInPostOrder().

◆ basicBlockCanReturn()

static bool basicBlockCanReturn ( BasicBlock BB)
static

Definition at line 1604 of file FunctionAttrs.cpp.

References BB, instructionDoesNotReturn(), and llvm::none_of().

Referenced by addNoReturnAttrs().

◆ calculatePrevailingSummary()

static FunctionSummary* calculatePrevailingSummary ( ValueInfo  VI,
DenseMap< ValueInfo, FunctionSummary * > &  CachedPrevailingSummary,
function_ref< bool(GlobalValue::GUID, const GlobalValueSummary *)>  IsPrevailing 
)
static

At this point, prevailing symbols have been resolved. The following leads to returning a conservative result:

  • Multiple instances with local linkage. Normally local linkage would be unique per module as the GUID includes the module path. We could have a guid alias if there wasn't any distinguishing path when each file was compiled, but that should be rare so we'll punt on those.

These next 2 cases should not happen and will assert:

  • Multiple instances with external linkage. This should be caught in symbol resolution
  • Non-existent FunctionSummary for Aliasee. This presents a hole in our knowledge meaning we have to go conservative.

Otherwise, we calculate attributes for a function as:

  1. If we have a local linkage, take its attributes. If there's somehow multiple, bail and go conservative.
  2. If we have an external/WeakODR/LinkOnceODR linkage check that it is prevailing, take its attributes.
  3. If we have a Weak/LinkOnce linkage the copies can have semantic differences. However, if the prevailing copy is known it will be used so take its attributes. If the prevailing copy is in a native file all IR copies will be dead and propagation will go conservative.
  4. AvailableExternally summaries without a prevailing copy are known to occur in a couple of circumstances: a. An internal function gets imported due to its caller getting imported, it becomes AvailableExternally but no prevailing definition exists. Because it has to get imported along with its caller the attributes will be captured by propagating on its caller. b. C++11 [temp.explicit]p10 can generate AvailableExternally definitions of explicitly instanced template declarations for inlining which are ultimately dropped from the TU. Since this is localized to the TU the attributes will have already made it to the callers. These are edge cases and already captured by their callers so we ignore these for now. If they become relevant to optimize in the future this can be revisited.
  5. Otherwise, go conservative.

Definition at line 336 of file FunctionAttrs.cpp.

References assert(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::count(), llvm::dbgs(), llvm::X86AS::FS, llvm::GlobalValue::isAvailableExternallyLinkage(), llvm::GlobalValue::isExternalLinkage(), llvm::GlobalValue::isLinkOnceAnyLinkage(), llvm::GlobalValue::isLinkOnceODRLinkage(), llvm::GlobalValue::isLocalLinkage(), llvm::GlobalValue::isWeakAnyLinkage(), llvm::GlobalValue::isWeakODRLinkage(), LLVM_DEBUG, and VI.

Referenced by llvm::thinLTOPropagateFunctionAttrs().

◆ checkFunctionMemoryAccess()

static MemoryAccessKind checkFunctionMemoryAccess ( Function F,
bool  ThisBody,
AAResults AAR,
const SCCNodeSet &  SCCNodes 
)
static

Returns the memory access attribute for function F using AAR for AA results, where SCCNodes is the current SCC.

If ThisBody is true, this function may examine the function body and will return a result pertaining to this copy of the function. If it is false, the result will be based only on AA results for the function declaration; it will be assumed that some other (perhaps less optimized) version of the function may be selected at link time.

Definition at line 122 of file FunctionAttrs.cpp.

References Arg, llvm::createModRefInfo(), llvm::AAResults::doesNotReadMemory(), E, F, llvm::FMRB_DoesNotAccessMemory, llvm::MemoryLocation::get(), llvm::MemoryLocation::getBeforeOrAfter(), llvm::AAResults::getModRefBehavior(), I, llvm::inst_begin(), llvm::inst_end(), llvm::isModSet(), llvm::isNoModRef(), llvm::isRefSet(), llvm::MAK_MayWrite, llvm::MAK_ReadNone, llvm::MAK_ReadOnly, llvm::MAK_WriteOnly, MRI, llvm::AAResults::onlyAccessesArgPointees(), llvm::AAResults::onlyReadsMemory(), llvm::AAResults::pointsToConstantMemory(), SI, and VI.

Referenced by addReadAttrs(), and llvm::computeFunctionBodyMemoryAccess().

◆ createSCCNodeSet()

static SCCNodesResult createSCCNodeSet ( ArrayRef< Function * >  Functions)
static

Definition at line 1751 of file FunctionAttrs.cpp.

References F, llvm::CallBase::getCalledFunction(), I, and llvm::instructions().

Referenced by deriveAttrsInPostOrder().

◆ deduceFunctionAttributeInRPO()

static bool deduceFunctionAttributeInRPO ( Module M,
CallGraph CG 
)
static

◆ deriveAttrsInPostOrder()

template<typename AARGetterT >
static bool deriveAttrsInPostOrder ( ArrayRef< Function * >  Functions,
AARGetterT &&  AARGetter 
)
static

◆ determinePointerReadAttrs()

static Attribute::AttrKind determinePointerReadAttrs ( Argument A,
const SmallPtrSet< Argument *, 8 > &  SCCNodes 
)
static

◆ functionWillReturn()

static bool functionWillReturn ( const Function F)
static

Definition at line 1630 of file FunctionAttrs.cpp.

References llvm::all_of(), F, llvm::FindFunctionBackedges(), I, and llvm::instructions().

Referenced by addWillReturn().

◆ inferAttrsFromFunctionBodies()

static bool inferAttrsFromFunctionBodies ( const SCCNodeSet &  SCCNodes)
static

Infer attributes from all functions in the SCC by scanning every instruction for compliance to the attribute assumptions.

Currently it does:

  • addition of NoUnwind attribute

Returns true if any changes to function attributes were made.

Definition at line 1513 of file FunctionAttrs.cpp.

References llvm::dbgs(), DisableNoFreeInference, DisableNoUnwindInference, F, I, InstrBreaksNoFree(), InstrBreaksNonThrowing(), and LLVM_DEBUG.

Referenced by deriveAttrsInPostOrder().

◆ inferConvergent()

static bool inferConvergent ( const SCCNodeSet &  SCCNodes)
static

Attempt to remove convergent function attribute when possible.

Returns true if any changes to function attributes were made.

Definition at line 1481 of file FunctionAttrs.cpp.

References llvm::MCID::Convergent, llvm::dbgs(), F, I, InstrBreaksNonConvergent(), and LLVM_DEBUG.

Referenced by deriveAttrsInPostOrder().

◆ INITIALIZE_PASS_BEGIN() [1/2]

INITIALIZE_PASS_BEGIN ( PostOrderFunctionAttrsLegacyPass  ,
"function-attrs ,
"Deduce function attributes ,
false  ,
false   
)

◆ INITIALIZE_PASS_BEGIN() [2/2]

INITIALIZE_PASS_BEGIN ( ReversePostOrderFunctionAttrsLegacyPass  ,
"rpo-function-attrs ,
"Deduce function attributes in RPO ,
false  ,
false   
)

◆ InstrBreaksNoFree()

static bool InstrBreaksNoFree ( Instruction I,
const SCCNodeSet &  SCCNodes 
)
static

Helper for NoFree inference predicate InstrBreaksAttribute.

Definition at line 1462 of file FunctionAttrs.cpp.

References Callee, llvm::CallBase::getCalledFunction(), llvm::CallBase::hasFnAttr(), and I.

Referenced by inferAttrsFromFunctionBodies().

◆ InstrBreaksNonConvergent()

static bool InstrBreaksNonConvergent ( Instruction I,
const SCCNodeSet &  SCCNodes 
)
static

Helper for non-Convergent inference predicate InstrBreaksAttribute.

Definition at line 1436 of file FunctionAttrs.cpp.

References llvm::CallBase::getCalledFunction(), I, and llvm::CallBase::isConvergent().

Referenced by inferConvergent().

◆ InstrBreaksNonThrowing()

static bool InstrBreaksNonThrowing ( Instruction I,
const SCCNodeSet &  SCCNodes 
)
static

Helper for NoUnwind inference predicate InstrBreaksAttribute.

Definition at line 1446 of file FunctionAttrs.cpp.

References Callee, and I.

Referenced by inferAttrsFromFunctionBodies().

◆ InstrBreaksNoSync()

static bool InstrBreaksNoSync ( Instruction I,
const SCCNodeSet &  SCCNodes 
)
static

◆ instructionDoesNotReturn()

static bool instructionDoesNotReturn ( Instruction I)
static

Definition at line 1596 of file FunctionAttrs.cpp.

References llvm::CallBase::hasFnAttr(), and I.

Referenced by basicBlockCanReturn().

◆ isFunctionMallocLike()

static bool isFunctionMallocLike ( Function F,
const SCCNodeSet &  SCCNodes 
)
static

Tests whether a function is "malloc-like".

A function is "malloc-like" if it returns either null or a pointer that doesn't alias any other pointer visible to the caller.

Definition at line 1071 of file FunctionAttrs.cpp.

References BB, llvm::MCID::Call, F, llvm::CallBase::getCalledFunction(), llvm::CallBase::hasRetAttr(), i, llvm::PHINode::incoming_values(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::insert(), LLVM_FALLTHROUGH, llvm::PointerMayBeCaptured(), llvm::MipsISD::Ret, llvm::MCID::Select, SI, and llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::size().

Referenced by addNoAliasAttrs().

◆ isOrderedAtomic()

static bool isOrderedAtomic ( Instruction I)
static

Definition at line 1680 of file FunctionAttrs.cpp.

References I, llvm_unreachable, SI, and llvm::SyncScope::SingleThread.

Referenced by InstrBreaksNoSync().

◆ isReturnNonNull()

static bool isReturnNonNull ( Function F,
const SCCNodeSet &  SCCNodes,
bool &  Speculative 
)
static

Tests whether this function is known to not return null.

Requires that the function returns a pointer.

Returns true if it believes the function will not return a null, and sets Speculative based on whether the returned conclusion is a speculative conclusion due to SCC calls.

Definition at line 1179 of file FunctionAttrs.cpp.

References assert(), BB, llvm::MCID::Call, Callee, DL, llvm::numbers::e, F, llvm::CallBase::getCalledFunction(), llvm::PHINode::getIncomingValue(), llvm::PHINode::getNumIncomingValues(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), i, llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::insert(), llvm::isKnownNonZero(), llvm_unreachable, llvm::MipsISD::Ret, llvm::MCID::Select, SI, and llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::size().

Referenced by addNonNullAttrs().

◆ runImpl()

template<typename AARGetterT >
static bool runImpl ( CallGraphSCC SCC,
AARGetterT  AARGetter 
)
static

Definition at line 1883 of file FunctionAttrs.cpp.

References deriveAttrsInPostOrder(), I, and llvm::AMDGPU::CPol::SCC.

◆ STATISTIC() [1/16]

STATISTIC ( NumNoAlias  ,
"Number of function returns marked noalias"   
)

◆ STATISTIC() [2/16]

STATISTIC ( NumNoCapture  ,
"Number of arguments marked nocapture"   
)

◆ STATISTIC() [3/16]

STATISTIC ( NumNoFree  ,
"Number of functions marked as nofree"   
)

◆ STATISTIC() [4/16]

STATISTIC ( NumNonNullReturn  ,
"Number of function returns marked nonnull"   
)

◆ STATISTIC() [5/16]

STATISTIC ( NumNoRecurse  ,
"Number of functions marked as norecurse"   
)

◆ STATISTIC() [6/16]

STATISTIC ( NumNoSync  ,
"Number of functions marked as nosync"   
)

◆ STATISTIC() [7/16]

STATISTIC ( NumNoUnwind  ,
"Number of functions marked as nounwind  
)

◆ STATISTIC() [8/16]

STATISTIC ( NumReadNone  ,
"Number of functions marked readnone  
)

◆ STATISTIC() [9/16]

STATISTIC ( NumReadNoneArg  ,
"Number of arguments marked readnone  
)

◆ STATISTIC() [10/16]

STATISTIC ( NumReadOnly  ,
"Number of functions marked readonly  
)

◆ STATISTIC() [11/16]

STATISTIC ( NumReadOnlyArg  ,
"Number of arguments marked readonly  
)

◆ STATISTIC() [12/16]

STATISTIC ( NumReturned  ,
"Number of arguments marked returned"   
)

◆ STATISTIC() [13/16]

STATISTIC ( NumThinLinkNoRecurse  ,
"Number of functions marked as norecurse during thinlink"   
)

◆ STATISTIC() [14/16]

STATISTIC ( NumThinLinkNoUnwind  ,
"Number of functions marked as nounwind during thinlink"   
)

◆ STATISTIC() [15/16]

STATISTIC ( NumWillReturn  ,
"Number of functions marked as willreturn"   
)

◆ STATISTIC() [16/16]

STATISTIC ( NumWriteOnly  ,
"Number of functions marked writeonly"   
)

Variable Documentation

◆ attributes

function Deduce function attributes

Definition at line 1876 of file FunctionAttrs.cpp.

◆ attrs

rpo function attrs

Definition at line 1875 of file FunctionAttrs.cpp.

◆ DisableNoFreeInference

cl::opt<bool> DisableNoFreeInference("disable-nofree-inference", cl::Hidden, cl::desc("Stop inferring nofree attribute during function-attrs pass"))
static

◆ DisableNoUnwindInference

cl::opt<bool> DisableNoUnwindInference("disable-nounwind-inference", cl::Hidden, cl::desc("Stop inferring nounwind attribute during function-attrs pass"))
static

◆ DisableThinLTOPropagation

cl::opt<bool> DisableThinLTOPropagation("disable-thinlto-funcattrs", cl::init(true), cl::Hidden, cl::desc("Don't propagate function-attrs in thinLTO"))
static

◆ EnableNonnullArgPropagation

cl::opt<bool> EnableNonnullArgPropagation("enable-nonnull-arg-prop", cl::init(true), cl::Hidden, cl::desc("Try to propagate nonnull argument attributes from callsites to " "caller functions."))
static

◆ false

rpo function Deduce function attributes in false

Definition at line 1876 of file FunctionAttrs.cpp.

◆ RPO

rpo function Deduce function attributes in RPO

Definition at line 1927 of file FunctionAttrs.cpp.