Go to the documentation of this file.
91 #define DEBUG_TYPE "argpromotion"
93 STATISTIC(NumArgumentsPromoted,
"Number of pointer arguments promoted");
94 STATISTIC(NumAggregatesPromoted,
"Number of aggregate arguments promoted");
95 STATISTIC(NumByValArgsPromoted,
"Number of byval arguments promoted");
96 STATISTIC(NumArgumentsDead,
"Number of dead pointer args eliminated");
112 std::vector<Type *> Params;
114 using ScalarizeTable = std::set<std::pair<Type *, IndicesVector>>;
122 std::map<Argument *, ScalarizeTable> ScalarizedElements;
129 std::map<std::pair<Argument *, IndicesVector>,
LoadInst *> OriginalLoads;
141 if (ByValArgsToTransform.
count(&*
I)) {
143 Type *AgTy = cast<PointerType>(
I->getType())->getElementType();
148 ++NumByValArgsPromoted;
149 }
else if (!ArgsToPromote.
count(&*
I)) {
151 Params.push_back(
I->getType());
153 }
else if (
I->use_empty()) {
162 ScalarizeTable &ArgIndices = ScalarizedElements[&*
I];
166 if (
LoadInst *L = dyn_cast<LoadInst>(UI))
167 SrcTy = L->getType();
169 SrcTy = cast<GetElementPtrInst>(UI)->getSourceElementType();
171 if (isa<GetElementPtrInst>(UI) && UI->
use_empty()) {
183 Indices.push_back(cast<ConstantInt>(*II)->getSExtValue());
185 if (Indices.size() == 1 && Indices.front() == 0)
187 ArgIndices.insert(std::make_pair(SrcTy, Indices));
189 if (
LoadInst *L = dyn_cast<LoadInst>(UI))
193 OrigLoad = cast<LoadInst>(UI->
user_back());
194 OriginalLoads[std::make_pair(&*
I, Indices)] = OrigLoad;
198 for (
const auto &ArgIndex : ArgIndices) {
201 cast<PointerType>(
I->getType())->getElementType(),
207 if (ArgIndices.size() == 1 && ArgIndices.begin()->second.empty())
208 ++NumArgumentsPromoted;
210 ++NumAggregatesPromoted;
228 F->setSubprogram(
nullptr);
230 LLVM_DEBUG(
dbgs() <<
"ARG PROMOTION: Promoting to:" << *NF <<
"\n"
239 F->getParent()->getFunctionList().insert(
F->getIterator(), NF);
246 while (!
F->use_empty()) {
247 CallBase &CB = cast<CallBase>(*
F->user_back());
258 if (!ArgsToPromote.
count(&*
I) && !ByValArgsToTransform.
count(&*
I)) {
261 }
else if (ByValArgsToTransform.
count(&*
I)) {
263 Type *AgTy = cast<PointerType>(
I->getType())->getElementType();
273 Idx->getName() +
".val"));
276 }
else if (!
I->use_empty()) {
278 ScalarizeTable &ArgIndices = ScalarizedElements[&*
I];
281 std::vector<Value *> Ops;
282 for (
const auto &ArgIndex : ArgIndices) {
285 OriginalLoads[std::make_pair(&*
I, ArgIndex.second)];
286 if (!ArgIndex.second.empty()) {
287 Ops.reserve(ArgIndex.second.size());
289 for (
auto II : ArgIndex.second) {
297 if (
auto *ElPTy = dyn_cast<PointerType>(ElTy))
298 ElTy = ElPTy->getElementType();
316 Args.push_back(newLoad);
322 for (; AI != CB.
arg_end(); ++AI, ++ArgNo) {
331 if (
InvokeInst *II = dyn_cast<InvokeInst>(&CB)) {
333 Args, OpBundles,
"", &CB);
336 NewCall->setTailCallKind(cast<CallInst>(&CB)->getTailCallKind());
343 NewCS->
copyMetadata(CB, {LLVMContext::MD_prof, LLVMContext::MD_dbg});
349 (*ReplaceCallSite)(CB, *NewCS);
351 if (!CB.use_empty()) {
352 CB.replaceAllUsesWith(NewCS);
358 CB.eraseFromParent();
373 if (!ArgsToPromote.
count(&*
I) && !ByValArgsToTransform.
count(&*
I)) {
376 I->replaceAllUsesWith(&*I2);
382 if (ByValArgsToTransform.
count(&*
I)) {
388 Type *AgTy = cast<PointerType>(
I->getType())->getElementType();
390 AgTy,
DL.getAllocaAddrSpace(),
nullptr,
391 I->getParamAlign().getValueOr(
DL.getPrefTypeAlign(AgTy)),
"",
400 AgTy, TheAlloca, Idxs, TheAlloca->
getName() +
"." +
Twine(
i),
402 I2->setName(
I->getName() +
"." +
Twine(
i));
407 I->replaceAllUsesWith(TheAlloca);
413 CallInst *Call = dyn_cast<CallInst>(U);
416 Call->setTailCall(
false);
432 ScalarizeTable &ArgIndices = ScalarizedElements[&*
I];
434 while (!
I->use_empty()) {
435 if (
LoadInst *LI = dyn_cast<LoadInst>(
I->user_back())) {
436 assert(ArgIndices.begin()->second.empty() &&
437 "Load element should sort to front!");
438 I2->setName(
I->getName() +
".val");
439 LI->replaceAllUsesWith(&*I2);
440 LI->eraseFromParent();
442 <<
"' in function '" <<
F->getName() <<
"'\n");
446 "GEPs without uses should be cleaned up already");
449 for (
const Use &Idx :
GEP->indices())
450 Operands.push_back(cast<ConstantInt>(Idx)->getSExtValue());
457 for (ScalarizeTable::iterator It = ArgIndices.begin();
458 It->second !=
Operands; ++It, ++TheArg) {
459 assert(It != ArgIndices.end() &&
"GEP not handled??");
466 <<
"' of function '" << NF->
getName() <<
"'\n");
470 while (!
GEP->use_empty()) {
475 GEP->eraseFromParent();
479 std::advance(I2, ArgIndices.size());
491 unsigned ArgNo =
Arg->getArgNo();
510 if (
Prefix.size() > Longer.size())
517 std::set<IndicesVector> &Set) {
518 std::set<IndicesVector>::iterator Low;
519 Low = Set.upper_bound(Indices);
520 if (Low != Set.begin())
527 return Low != Set.end() &&
isPrefix(*Low, Indices);
536 std::set<IndicesVector> &Safe) {
537 std::set<IndicesVector>::iterator Low;
538 Low = Safe.upper_bound(ToMark);
540 if (Low != Safe.begin())
545 if (Low != Safe.end()) {
555 Low = Safe.insert(Low, ToMark);
558 std::set<IndicesVector>::iterator End = Safe.end();
559 while (Low != End &&
isPrefix(ToMark, *Low)) {
560 std::set<IndicesVector>::iterator Remove = Low;
572 unsigned MaxElements) {
573 using GEPIndicesSet = std::set<IndicesVector>;
576 if (
Arg->use_empty())
594 GEPIndicesSet SafeToUnconditionallyLoad;
598 GEPIndicesSet ToPromote;
609 Type *BaseTy = ByValTy;
610 auto UpdateBaseTy = [&](
Type *NewBaseTy) {
612 return BaseTy == NewBaseTy;
616 assert(SafeToUnconditionallyLoad.empty());
629 if (
LoadInst *LI = dyn_cast<LoadInst>(&
I)) {
630 Value *V = LI->getPointerOperand();
632 V =
GEP->getPointerOperand();
635 Indices.reserve(
GEP->getNumIndices());
636 for (
Use &Idx :
GEP->indices())
638 Indices.push_back(CI->getSExtValue());
644 if (!UpdateBaseTy(
GEP->getSourceElementType()))
651 }
else if (V ==
Arg) {
655 if (BaseTy && LI->getType() != BaseTy)
658 BaseTy = LI->getType();
666 for (
Use &U :
Arg->uses()) {
667 User *UR = U.getUser();
669 if (
LoadInst *LI = dyn_cast<LoadInst>(UR)) {
677 if (!UpdateBaseTy(LI->getType()))
680 if (
GEP->use_empty()) {
686 if (!UpdateBaseTy(
GEP->getSourceElementType()))
690 for (
Use &Idx :
GEP->indices())
697 for (
User *GEPU :
GEP->users())
698 if (
LoadInst *LI = dyn_cast<LoadInst>(GEPU)) {
719 if (ToPromote.find(
Operands) == ToPromote.end()) {
720 if (MaxElements > 0 && ToPromote.size() == MaxElements) {
723 <<
"' because it would require adding more "
724 <<
"than " << MaxElements
725 <<
" arguments to the function.\n");
773 if (!
type->isSized())
778 if (
DL.getTypeSizeInBits(
type) !=
DL.getTypeAllocSizeInBits(
type))
790 if (!isa<StructType>(
type))
796 uint64_t StartPos = 0;
803 StartPos +=
DL.getTypeAllocSizeInBits(ElTy);
823 while (!WorkList.empty()) {
825 if (isa<GetElementPtrInst>(V) || isa<PHINode>(V)) {
826 if (PtrValues.
insert(V).second)
829 Stores.push_back(
Store);
830 }
else if (!isa<LoadInst>(V)) {
837 if (PtrValues.
count(
Store->getValueOperand()))
847 for (
const Use &U :
F.uses()) {
848 CallBase *CB = dyn_cast<CallBase>(U.getUser());
866 unsigned MaxElements,
873 if(
F->hasFnAttribute(Attribute::Naked))
877 if (!
F->hasLocalLinkage())
890 if (
F->getAttributes().hasAttrSomewhere(Attribute::InAlloca))
896 if (
I.getType()->isPointerTy())
897 PointerArgs.push_back(&
I);
898 if (PointerArgs.empty())
904 bool isSelfRecursive =
false;
905 for (
Use &U :
F->uses()) {
906 CallBase *CB = dyn_cast<CallBase>(U.getUser());
908 if (CB ==
nullptr || !CB->
isCallee(&U))
916 isSelfRecursive =
true;
922 if (
BB.getTerminatingMustTailCall())
933 for (
Argument *PtrArg : PointerArgs) {
934 Type *AgTy = cast<PointerType>(PtrArg->getType())->getElementType();
938 if (PtrArg->hasStructRetAttr()) {
939 unsigned ArgNo = PtrArg->getArgNo();
940 F->removeParamAttr(ArgNo, Attribute::StructRet);
941 F->addParamAttr(ArgNo, Attribute::NoAlias);
942 for (
Use &U :
F->uses()) {
943 CallBase &CB = cast<CallBase>(*U.getUser());
952 bool isSafeToPromote = PtrArg->hasByValAttr() &&
955 if (isSafeToPromote) {
956 if (
StructType *STy = dyn_cast<StructType>(AgTy)) {
957 if (MaxElements > 0 && STy->getNumElements() > MaxElements) {
960 <<
"' because it would require adding more"
961 <<
" than " << MaxElements
962 <<
" arguments to the function.\n");
967 bool AllSimple =
true;
968 for (
const auto *EltTy : STy->elements()) {
969 if (!EltTy->isSingleValueType()) {
979 ByValArgsToTransform.
insert(PtrArg);
987 if (isSelfRecursive) {
988 if (
StructType *STy = dyn_cast<StructType>(AgTy)) {
998 PtrArg->hasByValAttr() ? PtrArg->getParamByValType() :
nullptr;
1000 ArgsToPromote.
insert(PtrArg);
1004 if (ArgsToPromote.
empty() && ByValArgsToTransform.
empty())
1008 *
F,
TTI, ArgsToPromote, ByValArgsToTransform))
1011 return doPromotion(
F, ArgsToPromote, ByValArgsToTransform, ReplaceCallSite);
1018 bool Changed =
false, LocalChange;
1022 LocalChange =
false;
1032 assert(&
F == &OldF &&
"Called with an unexpected function!");
1048 C.getOuterRefSCC().replaceNodeFunction(
N, *NewF);
1053 Changed |= LocalChange;
1054 }
while (LocalChange);
1069 explicit ArgPromotion(
unsigned MaxElements = 3)
1087 bool doInitialization(
CallGraph &CG)
override;
1090 unsigned MaxElements;
1098 "Promote 'by reference' arguments to scalars",
false,
1108 return new ArgPromotion(MaxElements);
1117 CallGraph &CG = getAnalysis<CallGraphWrapperPass>().getCallGraph();
1121 bool Changed =
false, LocalChange;
1125 LocalChange =
false;
1138 cast<CallBase>(NewCS), NewCalleeNode);
1142 getAnalysis<TargetTransformInfoWrapperPass>().getTTI(*OldF);
1144 {ReplaceCallSite},
TTI)) {
1150 if (OldNode->getNumReferences() == 0)
1156 SCC.ReplaceNode(OldNode, NewNode);
1160 Changed |= LocalChange;
1161 }
while (LocalChange);
1166 bool ArgPromotion::doInitialization(
CallGraph &CG) {
A set of analyses that are preserved following a run of a transformation pass.
This class represents an incoming formal argument to a Function.
A manager for alias analyses.
Analysis pass providing the TargetTransformInfo.
pred_range predecessors(BasicBlock *BB)
void initializeArgPromotionPass(PassRegistry &)
static MemoryLocation get(const LoadInst *LI)
Return a location with information about the memory reference by the given instruction.
void getOperandBundlesAsDefs(SmallVectorImpl< OperandBundleDef > &Defs) const
Return the list of operand bundles attached to this instruction as a vector of OperandBundleDefs.
static InvokeInst * Create(FunctionType *Ty, Value *Func, BasicBlock *IfNormal, BasicBlock *IfException, ArrayRef< Value * > Args, const Twine &NameStr, Instruction *InsertBefore=nullptr)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
A parsed version of the target data layout string in and methods for querying it.
const Function * getParent() const
Return the enclosing method, or null if none.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
const BasicBlockListType & getBasicBlockList() const
Get the underlying elements of the Function...
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
void eraseFromParent()
eraseFromParent - This method unlinks 'this' from the containing module and deletes it.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
static AttributeList get(LLVMContext &C, ArrayRef< std::pair< unsigned, Attribute >> Attrs)
Create an AttributeList with the specified parameters in it.
The basic data container for the call graph of a Module of IR.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
The instances of the Type class are immutable: once they are created, they are never changed.
AttributeList getAttributes() const
Return the parameter attributes for this call.
bool isCallee(Value::const_user_iterator UI) const
Determine whether the passed iterator points to the callee operand's Use.
bool isMustTailCall() const
Tests if this call site must be tail call optimized.
void copyMetadata(const Instruction &SrcInst, ArrayRef< unsigned > WL=ArrayRef< unsigned >())
Copy metadata from SrcInst to this instruction.
User::op_iterator arg_begin()
Return the iterator pointing to the beginning of the argument list.
LLVM_NODISCARD T pop_back_val()
Class to represent array types.
void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Adds the attribute to the indicated argument.
Align getAlign() const
Return the alignment of the access that is being performed.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
static IntegerType * getInt32Ty(LLVMContext &C)
void getAAResultsAnalysisUsage(AnalysisUsage &AU)
A helper for the legacy pass manager to populate AU to add uses to make sure the analyses required by...
LLVM Basic Block Representation.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
CallGraphNode * getOrInsertFunction(const Function *F)
Similar to operator[], but this will insert a new CallGraphNode for F if one does not already exist.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
auto formatv(const char *Fmt, Ts &&... Vals) -> formatv_object< decltype(std::make_tuple(detail::build_format_adapter(std::forward< Ts >(Vals))...))>
This is the shared class of boolean and integer constants.
void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Removes the attribute from the given argument.
virtual bool doInitialization(CallGraph &CG)
doInitialization - This method is called before the SCC's of the program has been processed,...
CallGraphSCC - This is a single SCC that a CallGraphSCCPass is run on.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
An SCC of the call graph.
void getAAMetadata(AAMDNodes &N, bool Merge=false) const
Fills the AAMDNodes structure with AA metadata from this instruction.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
(vector float) vec_cmpeq(*A, *B) C
AttributeSet getFnAttributes() const
The function attributes are returned.
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation.
void setAttributes(AttributeList A)
Set the parameter attributes for this call.
LoadInst * CreateLoad(Type *Ty, Value *Ptr, const char *Name)
Provided to resolve 'CreateLoad(Ty, Ptr, "...")' correctly, instead of converting the string to 'bool...
void clear(IRUnitT &IR, llvm::StringRef Name)
Clear any cached analysis results for a single unit of IR.
static CallInst * Create(FunctionType *Ty, Value *F, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Represent the analysis usage information of a pass.
uint64_t getElementOffsetInBits(unsigned Idx) const
AttributeSet getParamAttributes(unsigned ArgNo) const
The attributes for the argument or parameter at the given index are returned.
LLVM_NODISCARD detail::scope_exit< typename std::decay< Callable >::type > make_scope_exit(Callable &&F)
bool isDereferenceablePointer(const Value *V, Type *Ty, const DataLayout &DL, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr)
Return true if this is always a dereferenceable pointer.
STATISTIC(NumFunctions, "Total number of functions")
void copyAttributesFrom(const Function *Src)
copyAttributesFrom - copy all additional attributes (those not needed to create a Function) from the ...
void setName(const Twine &Name)
Change the name of the value.
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
static Constant * get(Type *Ty, uint64_t V, bool IsSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
A node in the call graph for a module.
CallingConv::ID getCallingConv() const
Function * getCaller()
Helper to get the caller (the parent function).
mir Rename Register Operands
An efficient, type-erasing, non-owning reference to a callable.
Base class of all SIMD vector types.
An instruction for storing to memory.
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
void getAnalysisUsage(AnalysisUsage &Info) const override
getAnalysisUsage - For this class, we declare that we require and preserve the call graph.
Used to lazily calculate structure layout information for a target machine, based on the DataLayout s...
Instruction * user_back()
Specialize the methods defined in Value, as we know that an instruction can only be used by other ins...
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
void copyMetadata(const GlobalObject *Src, unsigned Offset)
Copy metadata from Src, adjusting offsets by Offset.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2, const MemoryLocation &Loc, const ModRefInfo Mode)
Check if it is possible for the execution of the specified instructions to mod(according to the mode)...
The ModulePass which wraps up a CallGraph and the logic to build it.
an instruction for type-safe pointer arithmetic to access elements of arrays and structs
void setAlignment(Align Align)
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
void setLinkage(LinkageTypes LT)
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Function * removeFunctionFromModule(CallGraphNode *CGN)
Unlink the function from this module, returning it.
Pass * createArgumentPromotionPass(unsigned maxElements=3)
createArgumentPromotionPass - This pass promotes "by reference" arguments to be passed by value if th...
User::op_iterator arg_end()
Return the iterator pointing to the end of the argument list.
A node in the call graph.
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
const Function & getFunction() const
static GetElementPtrInst * Create(Type *PointeeType, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
An immutable pass that tracks lazily created AssumptionCache objects.
Class to represent struct types.
virtual bool doInitialization(Module &)
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
Type * getType() const
All values are typed, get the type of this value.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
void append_range(Container &C, Range &&R)
Wrapper function to append a range to a container.
@ Mod
The access may modify the value stored in memory.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
StringRef getName() const
Return a constant reference to the value's name.
An instruction for reading from memory.
unsigned getNumElements() const
Random access to the elements.
amdgpu Simplify well known AMD library false FunctionCallee Callee
Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static IntegerType * getInt64Ty(LLVMContext &C)
ArrayRef< Type * > elements() const
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
bool hasByValAttr() const
Return true if this argument has the byval attribute.
void setAAMetadata(const AAMDNodes &N)
Sets the metadata on this instruction from the AAMDNodes structure.
static Type * getTypeAtIndex(Type *Ty, Value *Idx)
Return the type of the element at the given index of an indexable type.
static Type * getIndexedType(Type *Ty, ArrayRef< Value * > IdxList)
Returns the result type of a getelementptr with the given source element type and indexes.
we compile this esp call L1 $pb L1 esp je LBB1_2 esp ret but is currently always computed in the entry block It would be better to sink the picbase computation down into the block for the as it is the only one that uses it This happens for a lot of code with early outs Another example is loads of arguments
@ ExternalLinkage
Externally visible function.
AttributeSet getRetAttributes() const
The attributes for the ret value are returned.
Pass interface - Implemented by all 'passes'.
unsigned getNumOperands() const
bool isStructTy() const
True if this is an instance of StructType.
Value * getArgOperand(unsigned i) const
LLVM_NODISCARD bool empty() const
const BasicBlock * getParent() const
bool canBasicBlockModify(const BasicBlock &BB, const MemoryLocation &Loc)
Check if it is possible for execution of the specified basic block to modify the location Loc.
Type * getElementType(unsigned N) const
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
A container for analyses that lazily runs them and caches their results.
This class represents a function call, abstracting a target machine's calling convention.
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
AnalysisUsage & addRequired()
void takeName(Value *V)
Transfer the name from V to this value.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
an instruction to allocate memory on the stack
iterator_range< idf_ext_iterator< T, SetTy > > inverse_depth_first_ext(const T &G, SetTy &S)
A lazily constructed view of the call graph of a module.
A proxy from a FunctionAnalysisManager to an SCC.
Value * CreateGEP(Value *Ptr, ArrayRef< Value * > IdxList, const Twine &Name="")
void setAttributes(AttributeList Attrs)
Set the attribute list for this Function.
This class is a functor to be used in legacy module or SCC passes for computing AA results for a func...
Type * getReturnType() const
LLVM Value Representation.
iterator_range< user_iterator > users()
void stealCalledFunctionsFrom(CallGraphNode *N)
Moves all the callee information from N to this node.
Representation for a specific memory location.
void setCallingConv(CallingConv::ID CC)
Class to represent function types.
A Use represents the edge between a Value definition and its users.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
iterator insert(iterator I, T &&Elt)
void replaceCallEdge(CallBase &Call, CallBase &NewCall, CallGraphNode *NewNode)
Replaces the edge in the node for the specified call site with a new one.