Go to the documentation of this file.
86 #define DEBUG_TYPE "argpromotion"
88 STATISTIC(NumArgumentsPromoted,
"Number of pointer arguments promoted");
89 STATISTIC(NumByValArgsPromoted,
"Number of byval arguments promoted");
90 STATISTIC(NumArgumentsDead,
"Number of dead pointer args eliminated");
102 using OffsetAndArgPart = std::pair<int64_t, ArgPart>;
107 Value *Ptr,
Type *ResElemTy, int64_t Offset) {
111 APInt OrigOffset(
DL.getIndexTypeSizeInBits(Ptr->
getType()), Offset);
114 if (OrigOffset == 0 && OrigElemTy == ResElemTy)
118 APInt TmpOffset = OrigOffset;
119 Type *TmpTy = OrigElemTy;
121 DL.getGEPIndicesForOffset(TmpTy, TmpOffset);
122 if (TmpOffset == 0) {
124 while (TmpTy != ResElemTy) {
130 isa<StructType>(TmpTy) ? 32 : OrigOffset.
getBitWidth()));
138 if (OrigOffset != 0 || TmpTy == ResElemTy) {
139 Ptr = IRB.
CreateGEP(OrigElemTy, Ptr, Indices);
146 if (OrigOffset != 0) {
165 std::vector<Type *> Params;
177 if (ByValArgsToTransform.
count(&*
I)) {
179 Type *AgTy =
I->getParamByValType();
184 ++NumByValArgsPromoted;
185 }
else if (!ArgsToPromote.count(&*
I)) {
187 Params.push_back(
I->getType());
189 }
else if (
I->use_empty()) {
193 const auto &ArgParts = ArgsToPromote.find(&*
I)->second;
194 for (
const auto &Pair : ArgParts) {
195 Params.push_back(Pair.second.Ty);
198 ++NumArgumentsPromoted;
216 F->setSubprogram(
nullptr);
218 LLVM_DEBUG(
dbgs() <<
"ARG PROMOTION: Promoting to:" << *NF <<
"\n"
222 for (
auto *
I : Params)
223 if (
auto *VT = dyn_cast<llvm::VectorType>(
I))
225 LargestVectorWidth, VT->getPrimitiveSizeInBits().getKnownMinSize());
234 F->getParent()->getFunctionList().insert(
F->getIterator(), NF);
242 while (!
F->use_empty()) {
243 CallBase &CB = cast<CallBase>(*
F->user_back());
254 if (!ArgsToPromote.count(&*
I) && !ByValArgsToTransform.
count(&*
I)) {
257 }
else if (ByValArgsToTransform.
count(&*
I)) {
259 Type *AgTy =
I->getParamByValType();
264 Align StructAlign = *
I->getParamAlign();
265 for (
unsigned J = 0, Elems = STy->
getNumElements(); J != Elems; ++J) {
273 STy->
getElementType(J), Idx, Alignment, Idx->getName() +
".val"));
276 }
else if (!
I->use_empty()) {
278 const auto &ArgParts = ArgsToPromote.find(&*
I)->second;
279 for (
const auto &Pair : ArgParts) {
283 Pair.second.Alignment, V->
getName() +
".val");
284 if (Pair.second.MustExecLoad) {
285 LI->
setAAMetadata(Pair.second.MustExecLoad->getAAMetadata());
287 {LLVMContext::MD_range, LLVMContext::MD_nonnull,
288 LLVMContext::MD_dereferenceable,
289 LLVMContext::MD_dereferenceable_or_null,
290 LLVMContext::MD_align, LLVMContext::MD_noundef});
298 for (; AI != CB.
arg_end(); ++AI, ++ArgNo) {
307 if (
InvokeInst *II = dyn_cast<InvokeInst>(&CB)) {
309 Args, OpBundles,
"", &CB);
312 NewCall->setTailCallKind(cast<CallInst>(&CB)->getTailCallKind());
319 NewCS->
copyMetadata(CB, {LLVMContext::MD_prof, LLVMContext::MD_dbg});
328 (*ReplaceCallSite)(CB, *NewCS);
330 if (!CB.use_empty()) {
331 CB.replaceAllUsesWith(NewCS);
337 CB.eraseFromParent();
349 if (!ArgsToPromote.count(&
Arg) && !ByValArgsToTransform.
count(&
Arg)) {
352 Arg.replaceAllUsesWith(&*I2);
358 if (ByValArgsToTransform.
count(&
Arg)) {
364 Type *AgTy =
Arg.getParamByValType();
365 Align StructAlign = *
Arg.getParamAlign();
367 StructAlign,
"", InsertPt);
373 for (
unsigned J = 0, Elems = STy->
getNumElements(); J != Elems; ++J) {
376 AgTy, TheAlloca, Idxs, TheAlloca->
getName() +
"." +
Twine(J),
380 new StoreInst(&*I2++, Idx,
false, Alignment, InsertPt);
384 Arg.replaceAllUsesWith(TheAlloca);
398 for (
const auto &Pair : ArgsToPromote.find(&
Arg)->second) {
401 OffsetToArg.
insert({Pair.first, &NewArg});
410 while (!Worklist.empty()) {
412 if (isa<BitCastInst>(V) || isa<GetElementPtrInst>(V)) {
413 DeadInsts.push_back(cast<Instruction>(V));
418 if (
auto *LI = dyn_cast<LoadInst>(V)) {
419 Value *Ptr = LI->getPointerOperand();
424 assert(Ptr == &
Arg &&
"Not constant offset from arg?");
425 LI->replaceAllUsesWith(OffsetToArg[Offset.getSExtValue()]);
426 DeadInsts.push_back(LI);
435 I->eraseFromParent();
449 APInt Bytes(64, NeededDerefBytes);
458 CallBase &CB = cast<CallBase>(*U);
459 return isDereferenceableAndAlignedPointer(
460 CB.getArgOperand(Arg->getArgNo()), NeededAlign, Bytes, DL);
467 unsigned MaxElements,
bool IsRecursive,
470 if (
Arg->use_empty())
487 Align NeededAlign(1);
505 if (Offset.getSignificantBits() >= 64)
511 if (Size.isScalable())
519 int64_t Off = Offset.getSExtValue();
521 Off, ArgPart{Ty, LI->
getAlign(), GuaranteedToExecute ? LI :
nullptr});
522 ArgPart &Part = Pair.first->second;
523 bool OffsetNotSeenBefore = Pair.second;
527 if (MaxElements > 0 && ArgParts.
size() > MaxElements) {
529 <<
"more than " << MaxElements <<
" parts\n");
536 <<
"loaded via both " << *Part.Ty <<
" and " << *Ty
537 <<
" at offset " << Off <<
"\n");
547 if (!GuaranteedToExecute &&
548 (OffsetNotSeenBefore || Part.Alignment < LI->
getAlign())) {
557 NeededDerefBytes =
std::max(NeededDerefBytes, Off + Size.getFixedValue());
567 if (
LoadInst *LI = dyn_cast<LoadInst>(&
I))
581 auto AppendUsers = [&](
Value *V) {
583 if (Visited.
insert(U).second)
584 Worklist.push_back(U);
587 while (!Worklist.empty()) {
589 if (isa<BitCastInst>(V)) {
594 if (
auto *
GEP = dyn_cast<GetElementPtrInst>(V)) {
595 if (!
GEP->hasAllConstantIndices())
601 if (
auto *LI = dyn_cast<LoadInst>(V)) {
602 if (!*HandleLoad(LI,
false))
610 <<
"unknown user " << *V <<
"\n");
614 if (NeededDerefBytes || NeededAlign > 1) {
619 <<
"not dereferenceable or aligned\n");
624 if (ArgParts.
empty())
630 [](
const auto &A,
const auto &
B) {
return A.first <
B.first; });
635 int64_t Offset = ArgPartsVec[0].first;
636 for (
const auto &Pair : ArgPartsVec) {
637 if (Pair.first < Offset)
640 Offset = Pair.first +
DL.getTypeStoreSize(Pair.second.Ty);
684 if (
DL.getTypeSizeInBits(Ty) !=
DL.getTypeAllocSizeInBits(Ty))
689 if (
VectorType *SeqTy = dyn_cast<VectorType>(Ty))
693 if (
ArrayType *SeqTy = dyn_cast<ArrayType>(Ty))
696 if (!isa<StructType>(Ty))
709 StartPos +=
DL.getTypeAllocSizeInBits(ElTy);
729 while (!WorkList.empty()) {
731 if (isa<GetElementPtrInst>(V) || isa<PHINode>(V)) {
732 if (PtrValues.
insert(V).second)
735 Stores.push_back(
Store);
736 }
else if (!isa<LoadInst>(V)) {
743 if (PtrValues.
count(
Store->getValueOperand()))
754 CallBase *CB = dyn_cast<CallBase>(U.getUser());
758 const Function *Caller = CB->getCaller();
759 const Function *Callee = CB->getCalledFunction();
760 return TTI.areTypesABICompatible(Caller, Callee, Types);
770 unsigned MaxElements,
777 if(
F->hasFnAttribute(Attribute::Naked))
781 if (!
F->hasLocalLinkage())
794 if (
F->getAttributes().hasAttrSomewhere(Attribute::InAlloca))
800 if (
I.getType()->isPointerTy())
801 PointerArgs.push_back(&
I);
802 if (PointerArgs.empty())
808 for (
Use &U :
F->uses()) {
809 CallBase *CB = dyn_cast<CallBase>(U.getUser());
811 if (CB ==
nullptr || !CB->
isCallee(&U) ||
826 if (
BB.getTerminatingMustTailCall())
837 for (
Argument *PtrArg : PointerArgs) {
840 if (PtrArg->hasStructRetAttr()) {
841 unsigned ArgNo = PtrArg->getArgNo();
842 F->removeParamAttr(ArgNo, Attribute::StructRet);
843 F->addParamAttr(ArgNo, Attribute::NoAlias);
844 for (
Use &U :
F->uses()) {
845 CallBase &CB = cast<CallBase>(*U.getUser());
853 if (
findArgParts(PtrArg,
DL, AAR, MaxElements, IsRecursive, ArgParts)) {
855 for (
const auto &Pair : ArgParts)
856 Types.push_back(Pair.second.Ty);
871 Type *ByValTy = PtrArg->getParamByValType();
872 bool IsSafeToPromote =
873 ByValTy && PtrArg->getParamAlign() &&
876 if (!IsSafeToPromote) {
877 LLVM_DEBUG(
dbgs() <<
"ArgPromotion disables passing the elements of"
878 <<
" the argument '" << PtrArg->getName()
879 <<
"' because it is not safe.\n");
882 if (
StructType *STy = dyn_cast<StructType>(ByValTy)) {
883 if (MaxElements > 0 && STy->getNumElements() > MaxElements) {
884 LLVM_DEBUG(
dbgs() <<
"ArgPromotion disables passing the elements of"
885 <<
" the argument '" << PtrArg->getName()
886 <<
"' because it would require adding more"
887 <<
" than " << MaxElements
888 <<
" arguments to the function.\n");
901 ByValArgsToTransform.
insert(PtrArg);
906 if (ArgsToPromote.
empty() && ByValArgsToTransform.
empty())
909 return doPromotion(
F, ArgsToPromote, ByValArgsToTransform, ReplaceCallSite);
916 bool Changed =
false, LocalChange;
925 bool IsRecursive =
C.size() > 1;
932 assert(&
F == &OldF &&
"Called with an unexpected function!");
948 C.getOuterRefSCC().replaceNodeFunction(
N, *NewF);
954 for (
auto *U : NewF->users()) {
955 auto *UserF = cast<CallBase>(U)->getFunction();
960 Changed |= LocalChange;
961 }
while (LocalChange);
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.
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
Analysis pass providing the TargetTransformInfo.
bool isAligned(Align Lhs, uint64_t SizeInBytes)
Checks that SizeInBytes is a multiple of the alignment.
static MemoryLocation get(const LoadInst *LI)
Return a location with information about the memory reference by the given instruction.
This is an optimization pass for GlobalISel generic memory operations.
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)
A parsed version of the target data layout string in and methods for querying it.
bool isPointerTy() const
True if this is an instance of PointerType.
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...
void invalidate(IRUnitT &IR, const PreservedAnalyses &PA)
Invalidate cached analyses for an IR unit.
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.
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
This templated class represents "all analyses that operate over <a particular IR unit>" (e....
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.
FunctionAnalysisManager FAM
The instances of the Type class are immutable: once they are created, they are never changed.
unsigned getBitWidth() const
Return the number of bits in the APInt.
AttributeList getAttributes() const
Return the parameter attributes for this call.
FunctionType * getFunctionType() const
bool isCallee(Value::const_user_iterator UI) const
Determine whether the passed iterator points to the callee operand's Use.
AttributeSet getFnAttrs() const
The function attributes are returned.
bool isMustTailCall() const
Tests if this call site must be tail call optimized.
const Value * stripAndAccumulateConstantOffsets(const DataLayout &DL, APInt &Offset, bool AllowNonInbounds, bool AllowInvariantGroup=false, function_ref< bool(Value &Value, APInt &Offset)> ExternalAnalysis=nullptr) const
Accumulate the constant offset this value has compared to a base pointer.
Expected< ExpressionValue > max(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
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.
Value * getPointerOperand()
LoadInst * CreateAlignedLoad(Type *Ty, Value *Ptr, MaybeAlign Align, const char *Name)
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.
Type * getNonOpaquePointerElementType() const
Only use this method in code that is not reachable with opaque pointers, or part of deprecated method...
static APInt getZero(unsigned numBits)
Get the '0' value for the specified bit-width.
static IntegerType * getInt32Ty(LLVMContext &C)
LLVM Basic Block Representation.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
bool isSingleValueType() const
Return true if the type is a valid type for a register in codegen.
void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Removes the attribute from the given argument.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
An SCC of the call graph.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Value * CreateGEP(Type *Ty, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &Name="", bool IsInBounds=false)
(vector float) vec_cmpeq(*A, *B) C
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation or the function signa...
void setAttributes(AttributeList A)
Set the parameter attributes for this call.
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)
uint64_t getElementOffsetInBits(unsigned Idx) const
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
LLVM_NODISCARD detail::scope_exit< typename std::decay< Callable >::type > make_scope_exit(Callable &&F)
IntegerType * getInt8Ty()
Fetch the type representing an 8-bit integer.
STATISTIC(NumFunctions, "Total number of functions")
auto predecessors(MachineBasicBlock *BB)
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.
This struct is a compact representation of a valid (non-zero power of two) alignment.
CallingConv::ID getCallingConv() const
Function * getCaller()
Helper to get the caller (the parent function).
An efficient, type-erasing, non-owning reference to a callable.
Base class of all SIMD vector types.
Value * CreateBitCast(Value *V, Type *DestTy, const Twine &Name="")
An instruction for storing to memory.
AttributeSet getRetAttrs() const
The attributes for the ret value are returned.
Used to lazily calculate structure layout information for a target machine, based on the DataLayout s...
void preserve()
Mark an analysis as preserved.
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)...
PointerType * getInt8PtrTy(unsigned AddrSpace=0)
Fetch the type representing a pointer to an 8-bit integer value.
ConstantInt * getInt(const APInt &AI)
Get a constant integer value.
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.
Class for arbitrary precision integers.
static GetElementPtrInst * Create(Type *PointeeType, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Class to represent struct types.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Type * getType() const
All values are typed, get the type of this value.
Represents analyses that only rely on functions' control flow.
const Function * getFunction() const
Return the function this instruction belongs to.
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.
Common base class shared among various IRBuilders.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
void updateMinLegalVectorWidthAttr(Function &Fn, uint64_t Width)
Update min-legal-vector-width if it is in Attribute and less than Width.
StringRef getName() const
Return a constant reference to the value's name.
An instruction for reading from memory.
llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, 4, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::insert std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
unsigned getNumElements() const
Random access to the elements.
llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, 4, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::empty LLVM_NODISCARD bool empty() const
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...
Align commonAlignment(Align A, Align B)
Returns the alignment that satisfies both alignments.
ArrayRef< Type * > elements() const
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
uint64_t getElementOffset(unsigned Idx) const
bool isGuaranteedToTransferExecutionToSuccessor(const Instruction *I)
Return true if this function can prove that the instruction I will always transfer execution to one o...
void setAAMetadata(const AAMDNodes &N)
Sets the AA 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.
llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, 4, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::size unsigned size() const
void sort(IteratorTy Start, IteratorTy End)
PointerType * getPointerTo(unsigned AddrSpace=0) const
Return a pointer to the current type.
bool isOpaquePointerTy() const
True if this is an instance of an opaque PointerType.
void preserveSet()
Mark an analysis set as preserved.
LLVM_NODISCARD bool empty() const
llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, 4, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::try_emplace std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&... Args)
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.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
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.
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
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.
AttributeSet getParamAttrs(unsigned ArgNo) const
The attributes for the argument or parameter at the given index are returned.
A proxy from a FunctionAnalysisManager to an SCC.
void setAttributes(AttributeList Attrs)
Set the attribute list for this Function.
Type * getReturnType() const
LLVM Value Representation.
iterator_range< user_iterator > users()
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.
bool isDereferenceableAndAlignedPointer(const Value *V, Type *Ty, Align Alignment, const DataLayout &DL, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr)
Returns true if V is always a dereferenceable pointer with alignment greater or equal than requested.
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)
static PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.