Go to the documentation of this file.
76 #define DEBUG_TYPE "safe-stack"
80 STATISTIC(NumFunctions,
"Total number of functions");
81 STATISTIC(NumUnsafeStackFunctions,
"Number of functions with unsafe stack");
82 STATISTIC(NumUnsafeStackRestorePointsFunctions,
83 "Number of functions that use setjmp or exceptions");
85 STATISTIC(NumAllocas,
"Total number of allocas");
86 STATISTIC(NumUnsafeStaticAllocas,
"Number of unsafe static allocas");
87 STATISTIC(NumUnsafeDynamicAllocas,
"Number of unsafe dynamic allocas");
88 STATISTIC(NumUnsafeByValArguments,
"Number of unsafe byval arguments");
89 STATISTIC(NumUnsafeStackRestorePoints,
"Number of setjmps and landingpads");
100 cl::desc(
"enable safe stack coloring"),
122 Value *UnsafeStackPtr =
nullptr;
130 static constexpr
uint64_t StackAlignment = 16;
171 Value *StaticTop,
bool NeedDynamicTop);
176 void moveDynamicAllocasToUnsafeStack(
Function &
F,
Value *UnsafeStackPtr,
180 bool IsSafeStackAlloca(
const Value *AllocaPtr,
uint64_t AllocaSize);
187 bool ShouldInlinePointerAddress(
CallInst &CI);
188 void TryInlinePointerAddress();
193 :
F(
F), TL(TL),
DL(
DL), DTU(DTU), SE(SE),
194 StackPtrTy(
Type::getInt8PtrTy(
F.getContext())),
195 IntPtrTy(
DL.getIntPtrType(
F.getContext())),
197 Int8Ty(
Type::getInt8Ty(
F.getContext())) {}
204 constexpr
uint64_t SafeStack::StackAlignment;
212 Size *=
C->getZExtValue();
219 const SCEV *AddrExpr = SE.getSCEV(
Addr);
220 const auto *
Base = dyn_cast<SCEVUnknown>(SE.getPointerBase(AddrExpr));
221 if (!
Base ||
Base->getValue() != AllocaPtr) {
223 dbgs() <<
"[SafeStack] "
224 << (isa<AllocaInst>(AllocaPtr) ?
"Alloca " :
"ByValArgument ")
225 << *AllocaPtr <<
"\n"
226 <<
"SCEV " << *AddrExpr <<
" not directly based on alloca\n");
230 const SCEV *Expr = SE.removePointerBase(AddrExpr);
238 bool Safe = AllocaRange.
contains(AccessRange);
241 dbgs() <<
"[SafeStack] "
242 << (isa<AllocaInst>(AllocaPtr) ?
"Alloca " :
"ByValArgument ")
243 << *AllocaPtr <<
"\n"
244 <<
" Access " << *
Addr <<
"\n"
246 <<
" U: " << SE.getUnsignedRange(Expr)
247 <<
", S: " << SE.getSignedRange(Expr) <<
"\n"
248 <<
" Range " << AccessRange <<
"\n"
249 <<
" AllocaRange " << AllocaRange <<
"\n"
250 <<
" " << (Safe ?
"safe" :
"unsafe") <<
"\n");
256 const Value *AllocaPtr,
258 if (
auto MTI = dyn_cast<MemTransferInst>(
MI)) {
259 if (MTI->getRawSource() != U && MTI->getRawDest() != U)
262 if (
MI->getRawDest() != U)
266 const auto *Len = dyn_cast<ConstantInt>(
MI->getLength());
268 if (!Len)
return false;
269 return IsAccessSafe(U, Len->getZExtValue(), AllocaPtr, AllocaSize);
275 bool SafeStack::IsSafeStackAlloca(
const Value *AllocaPtr,
uint64_t AllocaSize) {
281 WorkList.push_back(AllocaPtr);
284 while (!WorkList.empty()) {
286 for (
const Use &UI : V->
uses()) {
287 auto I = cast<const Instruction>(UI.getUser());
290 switch (
I->getOpcode()) {
292 if (!IsAccessSafe(UI,
DL.getTypeStoreSize(
I->getType()), AllocaPtr,
297 case Instruction::VAArg:
301 if (V ==
I->getOperand(0)) {
304 <<
"[SafeStack] Unsafe alloca: " << *AllocaPtr
305 <<
"\n store of address: " << *
I <<
"\n");
309 if (!IsAccessSafe(UI,
DL.getTypeStoreSize(
I->getOperand(0)->getType()),
310 AllocaPtr, AllocaSize))
319 case Instruction::Invoke: {
322 if (
I->isLifetimeStartOrEnd())
326 if (!IsMemIntrinsicSafe(
MI, UI, AllocaPtr, AllocaSize)) {
328 <<
"[SafeStack] Unsafe alloca: " << *AllocaPtr
329 <<
"\n unsafe memintrinsic: " << *
I <<
"\n");
343 for (
auto A =
B;
A !=
E; ++
A)
348 <<
"\n unsafe call: " << *
I <<
"\n");
356 WorkList.push_back(cast<const Instruction>(
I));
366 Value *StackGuardVar = TL.getIRStackGuard(IRB);
369 if (!StackGuardVar) {
370 TL.insertSSPDeclarations(*M);
374 return IRB.
CreateLoad(StackPtrTy, StackGuardVar,
"StackGuard");
384 if (
auto AI = dyn_cast<AllocaInst>(&
I)) {
388 if (IsSafeStackAlloca(AI, Size))
392 ++NumUnsafeStaticAllocas;
393 StaticAllocas.push_back(AI);
395 ++NumUnsafeDynamicAllocas;
396 DynamicAllocas.push_back(AI);
398 }
else if (
auto RI = dyn_cast<ReturnInst>(&
I)) {
399 if (
CallInst *CI =
I.getParent()->getTerminatingMustTailCall())
400 Returns.push_back(CI);
402 Returns.push_back(RI);
403 }
else if (
auto CI = dyn_cast<CallInst>(&
I)) {
405 if (CI->getCalledFunction() && CI->canReturnTwice())
406 StackRestorePoints.push_back(CI);
407 }
else if (
auto LP = dyn_cast<LandingPadInst>(&
I)) {
409 StackRestorePoints.push_back(LP);
410 }
else if (
auto II = dyn_cast<IntrinsicInst>(&
I)) {
411 if (II->getIntrinsicID() == Intrinsic::gcroot)
413 "gcroot intrinsic not compatible with safestack attribute");
417 if (!
Arg.hasByValAttr())
420 if (IsSafeStackAlloca(&
Arg, Size))
423 ++NumUnsafeByValArguments;
424 ByValArguments.push_back(&
Arg);
431 Value *StaticTop,
bool NeedDynamicTop) {
432 assert(StaticTop &&
"The stack top isn't set.");
434 if (StackRestorePoints.
empty())
444 if (NeedDynamicTop) {
448 "unsafe_stack_dynamic_ptr");
454 ++NumUnsafeStackRestorePoints;
458 DynamicTop ? IRB.
CreateLoad(StackPtrTy, DynamicTop) : StaticTop;
474 FailureProb.getNumerator());
480 F.getParent()->getOrInsertFunction(
"__stack_chk_fail", IRB.
getVoidTy());
481 IRBFail.CreateCall(StackChkFail, {});
487 Value *SafeStack::moveStaticAllocasToUnsafeStack(
491 if (StaticAllocas.
empty() && ByValArguments.
empty())
501 for (
auto *
I : SSC.getMarkers()) {
502 auto *
Op = dyn_cast<Instruction>(
I->getOperand(1));
505 if (
Op &&
Op->use_empty())
506 Op->eraseFromParent();
511 if (StackGuardSlot) {
514 SSL.addObject(StackGuardSlot, getStaticAllocaAllocationSize(StackGuardSlot),
515 Align, SSC.getFullLiveRange());
519 Type *Ty =
Arg->getParamByValType();
526 if (
auto A =
Arg->getParamAlign())
528 SSL.addObject(
Arg, Size,
Align, SSC.getFullLiveRange());
540 SSL.addObject(AI, Size,
Align,
541 ClColoring ? SSC.getLiveRange(AI) : NoColoringRange);
545 Align FrameAlignment = SSL.getFrameAlignment();
549 if (FrameAlignment > StackAlignment) {
561 if (StackGuardSlot) {
562 unsigned Offset = SSL.getObjectOffset(StackGuardSlot);
574 unsigned Offset = SSL.getObjectOffset(
Arg);
576 Type *Ty =
Arg->getParamByValType();
585 Arg->getName() +
".unsafe-byval");
590 Arg->replaceAllUsesWith(NewArg);
598 unsigned Offset = SSL.getObjectOffset(AI);
605 std::string
Name = std::string(AI->
getName()) +
".unsafe";
611 if (
auto *PHI = dyn_cast<PHINode>(
User))
612 InsertBefore = PHI->getIncomingBlock(U)->getTerminator();
617 Value *
Off = IRBUser.CreateGEP(Int8Ty, BasePointer,
621 if (
auto *PHI = dyn_cast<PHINode>(
User))
624 PHI->setIncomingValueForBlock(PHI->getIncomingBlock(U), Replacement);
635 unsigned FrameSize =
alignTo(SSL.getFrameSize(), StackAlignment);
639 Data.push_back(MDB.createString(
"unsafe-stack-size"));
642 F.setMetadata(LLVMContext::MD_annotation, MD);
649 "unsafe_stack_static_top");
654 void SafeStack::moveDynamicAllocasToUnsafeStack(
664 if (ArraySize->
getType() != IntPtrTy)
691 if (AI->
hasName() && isa<Instruction>(NewAI))
699 if (!DynamicAllocas.empty()) {
702 auto *II = dyn_cast<IntrinsicInst>(&
I);
706 if (II->getIntrinsicID() == Intrinsic::stacksave) {
710 II->replaceAllUsesWith(LI);
711 II->eraseFromParent();
712 }
else if (II->getIntrinsicID() == Intrinsic::stackrestore) {
717 II->eraseFromParent();
723 bool SafeStack::ShouldInlinePointerAddress(
CallInst &CI) {
725 if (CI.
hasFnAttr(Attribute::AlwaysInline) &&
728 if (
Callee->isInterposable() ||
Callee->hasFnAttribute(Attribute::NoInline) ||
734 void SafeStack::TryInlinePointerAddress() {
735 auto *CI = dyn_cast<CallInst>(UnsafeStackPtr);
743 if (!Callee ||
Callee->isDeclaration())
746 if (!ShouldInlinePointerAddress(*CI))
754 assert(
F.hasFnAttribute(Attribute::SafeStack) &&
755 "Can't run SafeStack on a function without the attribute");
756 assert(!
F.isDeclaration() &&
"Can't run SafeStack on a function declaration");
774 findInsts(
F, StaticAllocas, DynamicAllocas, ByValArguments, Returns,
777 if (StaticAllocas.empty() && DynamicAllocas.empty() &&
778 ByValArguments.empty() && StackRestorePoints.empty())
781 if (!StaticAllocas.empty() || !DynamicAllocas.empty() ||
782 !ByValArguments.empty())
783 ++NumUnsafeStackFunctions;
785 if (!StackRestorePoints.empty())
786 ++NumUnsafeStackRestorePointsFunctions;
788 IRBuilder<> IRB(&
F.front(),
F.begin()->getFirstInsertionPt());
796 "__safestack_pointer_address", StackPtrTy->getPointerTo(0));
799 UnsafeStackPtr = TL.getSafeStackPointerLocation(IRB);
805 IRB.
CreateLoad(StackPtrTy, UnsafeStackPtr,
false,
"unsafe_stack_ptr");
810 if (
F.hasFnAttribute(Attribute::StackProtect) ||
811 F.hasFnAttribute(Attribute::StackProtectStrong) ||
812 F.hasFnAttribute(Attribute::StackProtectReq)) {
819 checkStackGuard(IRBRet,
F, *RI, StackGuardSlot, StackGuard);
825 Value *StaticTop = moveStaticAllocasToUnsafeStack(
826 IRB,
F, StaticAllocas, ByValArguments, BasePointer, StackGuardSlot);
834 AllocaInst *DynamicTop = createStackRestorePoints(
835 IRB,
F, StackRestorePoints, StaticTop, !DynamicAllocas.empty());
838 moveDynamicAllocasToUnsafeStack(
F, UnsafeStackPtr, DynamicTop,
847 TryInlinePointerAddress();
873 if (!
F.hasFnAttribute(Attribute::SafeStack)) {
875 " for this function\n");
879 if (
F.isDeclaration()) {
881 " is not available\n");
886 auto *TL =
TM->getSubtargetImpl(
F)->getTargetLowering();
890 auto *
DL = &
F.getParent()->getDataLayout();
891 auto &TLI = getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(
F);
892 auto &ACT = getAnalysis<AssumptionCacheTracker>().getAssumptionCache(
F);
899 bool ShouldPreserveDominatorTree;
905 if (
auto *DTWP = getAnalysisIfAvailable<DominatorTreeWrapperPass>()) {
906 DT = &DTWP->getDomTree();
907 ShouldPreserveDominatorTree =
true;
912 ShouldPreserveDominatorTree =
false;
922 return SafeStack(
F, *TL, *
DL, ShouldPreserveDominatorTree ? &DTU :
nullptr,
933 "Safe Stack instrumentation pass",
false,
false)
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
This class represents an incoming formal argument to a Function.
Value * CreateIntCast(Value *V, Type *DestTy, bool isSigned, const Twine &Name="")
StoreInst * CreateStore(Value *Val, Value *Ptr, bool isVolatile=false)
void SetInsertPoint(BasicBlock *TheBB)
This specifies that created instructions should be appended to the end of the specified block.
This is an optimization pass for GlobalISel generic memory operations.
This base class for TargetLowering contains the SelectionDAG-independent parts that can be used from ...
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
A parsed version of the target data layout string in and methods for querying it.
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
Align getAlign() const
Return the alignment of the memory that is being allocated by the instruction.
Value * CreatePtrToInt(Value *V, Type *DestTy, const Twine &Name="")
PointerType * getType() const
Overload to return most specific pointer type.
NodeTy * getNextNode()
Get the next node, or nullptr for the list tail.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
The main scalar evolution driver.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
bool hasFnAttr(Attribute::AttrKind Kind) const
Determine whether this call has the given attribute.
The instances of the Type class are immutable: once they are created, they are never changed.
This is the common base class for memset/memcpy/memmove.
InlineResult isInlineViable(Function &Callee)
Minimal filter to detect invalid constructs for inlining.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
User::op_iterator arg_begin()
Return the iterator pointing to the beginning of the argument list.
LLVM_NODISCARD T pop_back_val()
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
Compute the layout of an unsafe stack frame.
AllocaInst * CreateAlloca(Type *Ty, unsigned AddrSpace, Value *ArraySize=nullptr, const Twine &Name="")
Value * CreateIntToPtr(Value *V, Type *DestTy, const Twine &Name="")
bool empty() const
empty - Check if the array is empty.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
constexpr const T * getPointer() const
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 isStaticAlloca() const
Return true if this alloca is in the entry block of the function and is a constant size.
void initializeSafeStackLegacyPassPass(PassRegistry &)
Value * CreateMul(Value *LHS, Value *RHS, const Twine &Name="", bool HasNUW=false, bool HasNSW=false)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Type * getAllocatedType() const
Return the type that is being allocated by the instruction.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Value * CreateGEP(Type *Ty, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &Name="", bool IsInBounds=false)
static cl::opt< bool > ClColoring("safe-stack-coloring", cl::desc("enable safe stack coloring"), cl::Hidden, cl::init(true))
(vector float) vec_cmpeq(*A, *B) C
static cl::opt< bool > SafeStackUsePointerAddress("safestack-use-pointer-address", cl::init(false), cl::Hidden)
Use __safestack_pointer_address even if the platform has a faster way of access safe stack pointer.
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation or the function signa...
LoadInst * CreateLoad(Type *Ty, Value *Ptr, const char *Name)
Provided to resolve 'CreateLoad(Ty, Ptr, "...")' correctly, instead of converting the string to 'bool...
MDNode * createBranchWeights(uint32_t TrueWeight, uint32_t FalseWeight)
Return metadata containing two branch weights.
Represent the analysis usage information of a pass.
iterator_range< use_iterator > uses()
void SetCurrentDebugLocation(DebugLoc L)
Set location information used by debugging information.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Legacy analysis pass which computes a DominatorTree.
const Value * getArraySize() const
Get the number of elements allocated.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
STATISTIC(NumFunctions, "Total number of functions")
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.
User * getUser() const
Returns the User that contains this Use.
ConstantRange add(const ConstantRange &Other) const
Return a new range representing the possible values resulting from an addition of a value in this ran...
This struct is a compact representation of a valid (non-zero power of two) alignment.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
static BranchProbability getBranchProbStackProtector(bool IsLikely)
Value * CreateAnd(Value *LHS, Value *RHS, const Twine &Name="")
Value * CreatePointerCast(Value *V, Type *DestTy, const Twine &Name="")
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
PointerTypeMap run(const Module &M)
Compute the PointerTypeMap for the module M.
Target-Independent Code Generator Pass Configuration Options.
This class represents an analyzed expression in the program.
inst_range instructions(Function *F)
Value * CreateBitCast(Value *V, Type *DestTy, const Twine &Name="")
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
bool doesNotAccessMemory(unsigned OpNo) const
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
void emplace(ArgTypes &&... Args)
Create a new object by constructing it in place with the given arguments.
initializer< Ty > init(const Ty &Val)
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...
Compute live ranges of allocas.
bool doesNotCapture(unsigned OpNo) const
Determine whether this data operand is not captured.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Primary interface to the complete machine description for the target machine.
StandardInstrumentations SI(Debug, VerifyEach)
uint64_t getAlignment() const
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
A Module instance is used to store all the information related to an LLVM module.
User::op_iterator arg_end()
Return the iterator pointing to the end of the argument list.
Class for arbitrary precision integers.
An immutable pass that tracks lazily created AssumptionCache objects.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class represents a set of interesting instructions where an alloca is live.
Type * getType() const
All values are typed, get the type of this value.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
LLVMContext & getContext() const
All values hold a context through their type.
bool isArrayAllocation() const
Return true if there is an allocation size parameter to the allocation instruction that is not 1.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
INITIALIZE_PASS_BEGIN(SafeStackLegacyPass, DEBUG_TYPE, "Safe Stack instrumentation pass", false, false) INITIALIZE_PASS_END(SafeStackLegacyPass
StringRef getName() const
Return a constant reference to the value's name.
Safe Stack instrumentation pass
void replaceDbgValueForAlloca(AllocaInst *AI, Value *NewAllocaAddress, DIBuilder &Builder, int Offset=0)
Replaces multiple llvm.dbg.value instructions when the alloca it describes is replaced with a new val...
amdgpu Simplify well known AMD library false FunctionCallee Callee
static bool runOnFunction(Function &F, bool PostInlining)
CallInst * CreateMemCpy(Value *Dst, MaybeAlign DstAlign, Value *Src, MaybeAlign SrcAlign, uint64_t Size, bool isVolatile=false, MDNode *TBAATag=nullptr, MDNode *TBAAStructTag=nullptr, MDNode *ScopeTag=nullptr, MDNode *NoAliasTag=nullptr)
Create and insert a memcpy between the specified pointers.
bool isNoInline() const
Return true if the call should not be inlined.
uint64_t value() const
This is a hole in the type system and should not be abused.
constexpr unsigned BitWidth
This class captures the data input to the InlineFunction call, and records the auxiliary results prod...
bool contains(const APInt &Val) const
Return true if the specified value is in the set.
This class represents a range of values.
A wrapper class for inspecting calls to intrinsic functions.
Align max(MaybeAlign Lhs, Align Rhs)
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
InlineResult InlineFunction(CallBase &CB, InlineFunctionInfo &IFI, AAResults *CalleeAAR=nullptr, bool InsertLifetime=true, Function *ForwardVarArgsTo=nullptr)
This function inlines the called function into the basic block of the caller.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Type * getType() const
Return the LLVM type of this SCEV expression.
const char LLVMTargetMachineRef TM
FunctionPass class - This class is used to implement most global optimizations.
static Value * getStackGuard(const TargetLoweringBase *TLI, Module *M, IRBuilder<> &B, bool *SupportsSelectionDAGSP=nullptr)
Create a stack guard loading and populate whether SelectionDAG SSP is supported.
This class represents a function call, abstracting a target machine's calling convention.
Type * getVoidTy()
Fetch the type representing void.
Value * CreateICmpNE(Value *LHS, Value *RHS, const Twine &Name="")
AnalysisUsage & addRequired()
Value * CreateSub(Value *LHS, Value *RHS, const Twine &Name="", bool HasNUW=false, bool HasNSW=false)
void takeName(Value *V)
Transfer the name from V to this value.
Instruction * SplitBlockAndInsertIfThen(Value *Cond, Instruction *SplitBefore, bool Unreachable, MDNode *BranchWeights, DominatorTree *DT, LoopInfo *LI=nullptr, BasicBlock *ThenBlock=nullptr)
Split the containing block at the specified instruction - everything before SplitBefore stays in the ...
an instruction to allocate memory on the stack
FunctionPass * createSafeStackPass()
This pass splits the stack into a safe stack and an unsafe stack to protect against stack-based overf...
bool replaceDbgDeclare(Value *Address, Value *NewAddress, DIBuilder &Builder, uint8_t DIExprFlags, int Offset)
Replaces llvm.dbg.declare instruction when the address it describes is replaced with a new value.
LLVM Value Representation.
CallInst * CreateCall(FunctionType *FTy, Value *Callee, ArrayRef< Value * > Args=None, const Twine &Name="", MDNode *FPMathTag=nullptr)
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.