54 cl::desc(
"Convert noalias attributes to metadata during inlining."));
59 cl::desc(
"Convert align attributes to assumptions during inlining."));
62 AAResults *CalleeAAR,
bool InsertLifetime) {
66 AAResults *CalleeAAR,
bool InsertLifetime) {
72 class LandingPadInliningInfo {
81 : OuterResumeDest(II->getUnwindDest()), InnerResumeDest(nullptr),
82 CallerLPad(nullptr), InnerEHValuesPHI(nullptr) {
88 for (; isa<PHINode>(
I); ++
I) {
94 CallerLPad = cast<LandingPadInst>(
I);
100 return OuterResumeDest;
117 void addIncomingPHIValuesFor(
BasicBlock *BB)
const {
118 addIncomingPHIValuesForInto(BB, OuterResumeDest);
123 for (
unsigned i = 0, e = UnwindDestPHIValues.size(); i != e; ++i, ++
I) {
132 BasicBlock *LandingPadInliningInfo::getInnerResumeDest() {
133 if (InnerResumeDest)
return InnerResumeDest;
138 OuterResumeDest->splitBasicBlock(SplitPoint,
139 OuterResumeDest->getName() +
".body");
142 const unsigned PHICapacity = 2;
145 Instruction *InsertPoint = &InnerResumeDest->front();
147 for (
unsigned i = 0, e = UnwindDestPHIValues.size(); i != e; ++i, ++
I) {
148 PHINode *OuterPHI = cast<PHINode>(
I);
150 OuterPHI->
getName() +
".lpad-body",
153 InnerPHI->addIncoming(OuterPHI, OuterResumeDest);
158 "eh.lpad-body", InsertPoint);
160 InnerEHValuesPHI->addIncoming(CallerLPad, OuterResumeDest);
163 return InnerResumeDest;
170 void LandingPadInliningInfo::forwardResume(
179 addIncomingPHIValuesForInto(Src, Dest);
181 InnerEHValuesPHI->addIncoming(RI->
getOperand(0), Src);
187 if (
auto *FPI = dyn_cast<FuncletPadInst>(EHPad))
188 return FPI->getParentPad();
200 while (!Worklist.
empty()) {
207 Value *UnwindDestToken =
nullptr;
208 if (
auto *CatchSwitch = dyn_cast<CatchSwitchInst>(CurrentPad)) {
209 if (CatchSwitch->hasUnwindDest()) {
210 UnwindDestToken = CatchSwitch->getUnwindDest()->getFirstNonPHI();
218 for (
auto HI = CatchSwitch->handler_begin(),
219 HE = CatchSwitch->handler_end();
220 HI != HE && !UnwindDestToken; ++
HI) {
222 auto *CatchPad = cast<CatchPadInst>(HandlerBlock->
getFirstNonPHI());
228 if (!isa<CleanupPadInst>(Child) && !isa<CatchSwitchInst>(Child))
232 auto Memo = MemoMap.
find(ChildPad);
233 if (Memo == MemoMap.
end()) {
240 Value *ChildUnwindDestToken = Memo->second;
241 if (!ChildUnwindDestToken)
247 if (isa<ConstantTokenNone>(ChildUnwindDestToken)) {
248 UnwindDestToken = ChildUnwindDestToken;
256 auto *CleanupPad = cast<CleanupPadInst>(CurrentPad);
258 if (
auto *CleanupRet = dyn_cast<CleanupReturnInst>(U)) {
259 if (
BasicBlock *RetUnwindDest = CleanupRet->getUnwindDest())
260 UnwindDestToken = RetUnwindDest->getFirstNonPHI();
265 Value *ChildUnwindDestToken;
266 if (
auto *Invoke = dyn_cast<InvokeInst>(U)) {
267 ChildUnwindDestToken = Invoke->getUnwindDest()->getFirstNonPHI();
268 }
else if (isa<CleanupPadInst>(U) || isa<CatchSwitchInst>(U)) {
270 auto Memo = MemoMap.
find(ChildPad);
271 if (Memo == MemoMap.
end()) {
278 ChildUnwindDestToken = Memo->second;
279 if (!ChildUnwindDestToken)
288 if (isa<Instruction>(ChildUnwindDestToken) &&
291 UnwindDestToken = ChildUnwindDestToken;
297 if (!UnwindDestToken)
305 if (
auto *UnwindPad = dyn_cast<Instruction>(UnwindDestToken))
308 UnwindParent =
nullptr;
309 bool ExitedOriginalPad =
false;
311 ExitedPad && ExitedPad != UnwindParent;
314 if (isa<CatchPadInst>(ExitedPad))
316 MemoMap[ExitedPad] = UnwindDestToken;
317 ExitedOriginalPad |= (ExitedPad == EHPad);
320 if (ExitedOriginalPad)
321 return UnwindDestToken;
352 if (
auto *CPI = dyn_cast<CatchPadInst>(EHPad))
353 EHPad = CPI->getCatchSwitch();
356 auto Memo = MemoMap.
find(EHPad);
357 if (Memo != MemoMap.
end())
362 assert((UnwindDestToken ==
nullptr) != (MemoMap.
count(EHPad) != 0));
364 return UnwindDestToken;
371 MemoMap[EHPad] =
nullptr;
377 Value *AncestorToken;
382 if (isa<CatchPadInst>(AncestorPad))
391 assert(!MemoMap.
count(AncestorPad) || MemoMap[AncestorPad]);
392 auto AncestorMemo = MemoMap.
find(AncestorPad);
393 if (AncestorMemo == MemoMap.
end()) {
396 UnwindDestToken = AncestorMemo->second;
400 LastUselessPad = AncestorPad;
401 MemoMap[LastUselessPad] =
nullptr;
403 TempMemos.
insert(LastUselessPad);
421 while (!Worklist.
empty()) {
423 auto Memo = MemoMap.
find(UselessPad);
424 if (Memo != MemoMap.
end() && Memo->second) {
452 MemoMap[UselessPad] = UnwindDestToken;
453 if (
auto *CatchSwitch = dyn_cast<CatchSwitchInst>(UselessPad)) {
454 assert(CatchSwitch->getUnwindDest() ==
nullptr &&
"Expected useless pad");
455 for (
BasicBlock *HandlerBlock : CatchSwitch->handlers()) {
456 auto *CatchPad = HandlerBlock->getFirstNonPHI();
459 (!isa<InvokeInst>(U) ||
461 cast<InvokeInst>(U)->getUnwindDest()->getFirstNonPHI()) ==
463 "Expected useless pad");
464 if (isa<CatchSwitchInst>(U) || isa<CleanupPadInst>(U))
465 Worklist.
push_back(cast<Instruction>(U));
469 assert(isa<CleanupPadInst>(UselessPad));
471 assert(!isa<CleanupReturnInst>(U) &&
"Expected useless pad");
472 assert((!isa<InvokeInst>(U) ||
474 cast<InvokeInst>(U)->getUnwindDest()->getFirstNonPHI()) ==
476 "Expected useless pad");
477 if (isa<CatchSwitchInst>(U) || isa<CleanupPadInst>(U))
478 Worklist.
push_back(cast<Instruction>(U));
483 return UnwindDestToken;
511 if (
F->getIntrinsicID() == Intrinsic::experimental_deoptimize ||
512 F->getIntrinsicID() == Intrinsic::experimental_guard)
523 auto *FuncletPad = cast<Instruction>(FuncletBundle->Inputs[0]);
524 Value *UnwindDestToken =
526 if (UnwindDestToken && !isa<ConstantTokenNone>(UnwindDestToken))
530 if (
auto *CatchPad = dyn_cast<CatchPadInst>(FuncletPad))
531 MemoKey = CatchPad->getCatchSwitch();
533 MemoKey = FuncletPad;
534 assert(FuncletUnwindMap->count(MemoKey) &&
535 (*FuncletUnwindMap)[MemoKey] == UnwindDestToken &&
536 "must get memoized to avoid confusing later searches");
561 LandingPadInliningInfo Invoke(II);
567 if (
InvokeInst *II = dyn_cast<InvokeInst>(I->getTerminator()))
575 InlinedLPad->reserveClauses(OuterNum);
576 for (
unsigned OuterIdx = 0; OuterIdx != OuterNum; ++OuterIdx)
577 InlinedLPad->addClause(OuterLPad->
getClause(OuterIdx));
579 InlinedLPad->setCleanup(
true);
586 &*BB, Invoke.getOuterResumeDest()))
589 Invoke.addIncomingPHIValuesFor(NewBB);
592 if (
ResumeInst *RI = dyn_cast<ResumeInst>(BB->getTerminator()))
593 Invoke.forwardResume(RI, InlinedLPads);
633 for (
Value *V : UnwindDestPHIValues) {
645 if (
auto *CRI = dyn_cast<CleanupReturnInst>(BB->getTerminator())) {
646 if (CRI->unwindsToCaller()) {
647 auto *CleanupPad = CRI->getCleanupPad();
649 CRI->eraseFromParent();
656 isa<ConstantTokenNone>(FuncletUnwindMap[CleanupPad]));
657 FuncletUnwindMap[CleanupPad] =
667 if (
auto *CatchSwitch = dyn_cast<CatchSwitchInst>(I)) {
668 if (CatchSwitch->unwindsToCaller()) {
669 Value *UnwindDestToken;
670 if (
auto *ParentPad =
671 dyn_cast<Instruction>(CatchSwitch->getParentPad())) {
681 if (UnwindDestToken && !isa<ConstantTokenNone>(UnwindDestToken))
694 CatchSwitch->getParentPad(), UnwindDest,
695 CatchSwitch->getNumHandlers(), CatchSwitch->getName(),
697 for (
BasicBlock *PadBB : CatchSwitch->handlers())
703 FuncletUnwindMap[NewCatchSwitch] = UnwindDestToken;
704 Replacement = NewCatchSwitch;
706 }
else if (!isa<FuncletPadInst>(I)) {
723 &*BB, UnwindDest, &FuncletUnwindMap))
732 UnwindDest->removePredecessor(InvokeBB);
746 VMI != VMIE; ++VMI) {
793 while (!Queue.empty()) {
794 const MDNode *M = cast<MDNode>(Queue.pop_back_val());
805 for (
const MDNode *I : MD) {
807 MDMap[
I].reset(DummyNodes.
back().get());
813 for (
const MDNode *I : MD) {
815 for (
unsigned i = 0, ie = I->getNumOperands(); i != ie; ++i) {
816 const Metadata *V = I->getOperand(i);
817 if (
const MDNode *M = dyn_cast<MDNode>(V))
820 NewOps.
push_back(const_cast<Metadata *>(V));
824 MDTuple *TempM = cast<MDTuple>(MDMap[
I]);
825 assert(TempM->isTemporary() &&
"Expected temporary node");
827 TempM->replaceAllUsesWith(NewM);
833 VMI != VMIE; ++VMI) {
885 if (Arg.hasNoAliasAttr() && !Arg.use_empty())
888 if (NoAliasArgs.
empty())
894 DT.
recalculate(const_cast<Function&>(*CalledFunc));
907 MDB.createAnonymousAliasScopeDomain(CalledFunc->
getName());
908 for (
unsigned i = 0, e = NoAliasArgs.
size(); i != e; ++i) {
916 Name +=
": argument ";
923 MDNode *NewScope = MDB.createAnonymousAliasScope(NewDomain, Name);
924 NewScopes.
insert(std::make_pair(A, NewScope));
930 VMI != VMIE; ++VMI) {
931 if (
const Instruction *I = dyn_cast<Instruction>(VMI->first)) {
939 bool IsArgMemOnlyCall =
false, IsFuncCall =
false;
942 if (
const LoadInst *LI = dyn_cast<LoadInst>(I))
943 PtrArgs.
push_back(LI->getPointerOperand());
944 else if (
const StoreInst *
SI = dyn_cast<StoreInst>(I))
946 else if (
const VAArgInst *VAAI = dyn_cast<VAArgInst>(I))
947 PtrArgs.
push_back(VAAI->getPointerOperand());
949 PtrArgs.
push_back(CXI->getPointerOperand());
950 else if (
const AtomicRMWInst *RMWI = dyn_cast<AtomicRMWInst>(I))
951 PtrArgs.
push_back(RMWI->getPointerOperand());
956 if (ICS.doesNotAccessMemory())
964 IsArgMemOnlyCall =
true;
967 for (
Value *Arg : ICS.args()) {
973 if (IsArgMemOnlyCall && !Arg->getType()->isPointerTy())
984 if (PtrArgs.
empty() && !IsFuncCall)
994 for (
const Value *V : PtrArgs) {
997 Objects, DL,
nullptr);
999 for (
Value *O : Objects)
1005 bool CanDeriveViaCapture =
false, UsesAliasingPtr =
false;
1006 for (
const Value *V : ObjSet) {
1010 bool IsNonPtrConst = isa<ConstantInt>(V) || isa<ConstantFP>(V) ||
1011 isa<ConstantPointerNull>(V) ||
1012 isa<ConstantDataVector>(V) || isa<UndefValue>(V);
1019 if (
const Argument *
A = dyn_cast<Argument>(V)) {
1020 if (!
A->hasNoAliasAttr())
1021 UsesAliasingPtr =
true;
1023 UsesAliasingPtr =
true;
1030 if (!isa<Argument>(V) &&
1032 CanDeriveViaCapture =
true;
1037 if (IsFuncCall && !IsArgMemOnlyCall)
1038 CanDeriveViaCapture =
true;
1049 if (!ObjSet.count(
A) && (!CanDeriveViaCapture ||
1062 if (!NoAliases.
empty())
1078 bool CanAddScopes = !UsesAliasingPtr;
1079 if (CanAddScopes && IsFuncCall)
1080 CanAddScopes = IsArgMemOnlyCall;
1084 if (ObjSet.count(
A))
1088 if (!Scopes.
empty())
1109 bool DTCalculated =
false;
1113 unsigned Align = Arg.getType()->isPointerTy() ? Arg.getParamAlignment() : 0;
1114 if (Align && !Arg.hasByValOrInAllocaAttr() && !Arg.hasNUses(0)) {
1115 if (!DTCalculated) {
1117 DTCalculated =
true;
1127 .CreateAlignmentAssumption(
DL, ArgVal, Align);
1153 if (CalleeNode == CallerNode) {
1154 CallCache.assign(I,
E);
1155 I = CallCache.begin();
1156 E = CallCache.end();
1159 for (; I !=
E; ++
I) {
1160 const Value *OrigCall = I->first;
1164 if (VMI == VMap.
end() || VMI->
second ==
nullptr)
1188 if (!I->second->getFunction())
1207 Type *AggTy = cast<PointerType>(Src->
getType())->getElementType();
1215 Builder.CreateMemCpy(Dst, Src, Size, 1);
1223 unsigned ByValAlignment) {
1237 if (ByValAlignment <= 1)
1259 Align =
std::max(Align, ByValAlignment);
1263 &*Caller->
begin()->begin());
1275 switch (II->getIntrinsicID()) {
1277 case Intrinsic::lifetime_start:
1278 case Intrinsic::lifetime_end:
1292 if (Ty == Int8PtrTy)
1297 if (U->getType() != Int8PtrTy)
continue;
1298 if (U->stripPointerCasts() != AI)
continue;
1326 Ctx, InlinedAtNode->getLine(), InlinedAtNode->getColumn(),
1327 InlinedAtNode->getScope(), InlinedAtNode->getInlinedAt());
1334 for (; FI != Fn->
end(); ++FI) {
1341 BI->setDebugLoc(IDL);
1345 if (CalleeHasDebugInfo)
1354 if (
auto *AI = dyn_cast<AllocaInst>(BI))
1358 BI->setDebugLoc(TheCallDL);
1374 for (
auto const &Entry : VMap) {
1375 if (!isa<BasicBlock>(Entry.first) || !Entry.second)
1377 auto *OrigBB = cast<BasicBlock>(Entry.first);
1378 auto *ClonedBB = cast<BasicBlock>(Entry.second);
1380 if (!ClonedBBs.
insert(ClonedBB).second) {
1390 BasicBlock *EntryClone = cast<BasicBlock>(VMap.lookup(&CalleeEntryBlock));
1406 uint64_t CallCount =
1410 for (
auto const &Entry : VMap)
1411 if (isa<CallInst>(Entry.first))
1412 if (
auto *CI = dyn_cast_or_null<CallInst>(Entry.second))
1413 CI->updateProfWeight(CallCount, CalleeEntryCount.
getValue());
1416 if (VMap.count(&BB))
1418 if (
CallInst *CI = dyn_cast<CallInst>(&I))
1419 CI->updateProfWeight(CalleeEntryCount.
getValue() - CallCount,
1435 if (!CalleeCount.
hasValue() || !PSI)
1457 AAResults *CalleeAAR,
bool InsertLifetime) {
1460 &&
"Instruction not in function!");
1497 if (CalledFunc->
hasGC()) {
1498 if (!Caller->
hasGC())
1500 else if (CalledFunc->
getGC() != Caller->
getGC())
1517 if (CalledPersonality) {
1518 if (!CallerPersonality)
1524 else if (CalledPersonality != CallerPersonality)
1531 if (CallerPersonality) {
1537 CallSiteEHPad = cast<FuncletPadInst>(ParentFunclet->
Inputs.front());
1541 if (CallSiteEHPad) {
1545 if (isa<CleanupPadInst>(CallSiteEHPad)) {
1548 for (
const BasicBlock &CalledBB : *CalledFunc) {
1549 if (isa<CatchSwitchInst>(CalledBB.getFirstNonPHI()))
1556 for (
const BasicBlock &CalledBB : *CalledFunc) {
1557 if (CalledBB.isEHPad())
1567 bool EHPadForCallUnwindsLocally =
false;
1568 if (CallSiteEHPad && CS.
isCall()) {
1570 Value *CallSiteUnwindDestToken =
1573 EHPadForCallUnwindsLocally =
1574 CallSiteUnwindDestToken &&
1575 !isa<ConstantTokenNone>(CallSiteUnwindDestToken);
1596 "No varargs calls can be inlined!");
1603 E = CalledFunc->
arg_end(); I !=
E; ++
I, ++AI, ++ArgNo) {
1604 Value *ActualArg = *AI;
1613 if (ActualArg != *AI)
1617 VMap[&*
I] = ActualArg;
1630 false, Returns,
".i",
1631 &InlinedFunctionInfo, TheCall);
1633 FirstNewBlock = LastBlock; ++FirstNewBlock;
1638 CalledFunc->
front());
1646 for (std::pair<Value*, Value*> &
Init : ByValInit)
1648 &*FirstNewBlock, IFI);
1656 Instruction *I = dyn_cast_or_null<Instruction>(VH);
1676 std::vector<Value *> MergedDeoptArgs;
1677 MergedDeoptArgs.reserve(ParentDeopt->Inputs.size() +
1678 ChildOB.Inputs.size());
1680 MergedDeoptArgs.insert(MergedDeoptArgs.end(),
1681 ParentDeopt->Inputs.begin(),
1682 ParentDeopt->Inputs.end());
1683 MergedDeoptArgs.insert(MergedDeoptArgs.end(), ChildOB.Inputs.begin(),
1684 ChildOB.Inputs.end());
1686 OpDefs.
emplace_back(
"deopt", std::move(MergedDeoptArgs));
1690 if (isa<CallInst>(I))
1728 if (
auto *II = dyn_cast<IntrinsicInst>(&I))
1729 if (II->getIntrinsicID() == Intrinsic::assume)
1741 E = FirstNewBlock->end(); I !=
E; ) {
1760 while (isa<AllocaInst>(I) &&
1770 InsertPoint, FirstNewBlock->getInstList(), AI->
getIterator(),
I);
1778 bool InlinedMustTailCalls =
false, InlinedDeoptimizeCalls =
false;
1781 if (
CallInst *CI = dyn_cast<CallInst>(TheCall))
1782 CallSiteTailKind = CI->getTailCallKind();
1792 InlinedDeoptimizeCalls |=
1793 F->getIntrinsicID() == Intrinsic::experimental_deoptimize;
1809 ChildTCK =
std::min(CallSiteTailKind, ChildTCK);
1825 for (
unsigned ai = 0, ae = IFI.
StaticAllocas.size(); ai != ae; ++ai) {
1843 uint64_t AllocaArraySize = AIArraySize->getLimitedValue();
1846 if (AllocaArraySize == 0)
1851 if (AllocaArraySize != ~0ULL &&
1852 UINT64_MAX / AllocaArraySize >= AllocaTypeSize) {
1854 AllocaArraySize * AllocaTypeSize);
1858 builder.CreateLifetimeStart(AI, AllocaSize);
1862 if (InlinedMustTailCalls &&
1865 if (InlinedDeoptimizeCalls &&
1868 IRBuilder<>(RI).CreateLifetimeEnd(AI, AllocaSize);
1883 .CreateCall(StackSave, {},
"savedstack");
1894 IRBuilder<>(RI).CreateCall(StackRestore, SavedPtr);
1902 if (
auto *II = dyn_cast<InvokeInst>(TheCall)) {
1905 if (isa<LandingPadInst>(FirstNonPHI)) {
1916 if (CallSiteEHPad) {
1931 if (CalledFn && CalledFn->isIntrinsic() && CS.
doesNotThrow())
1957 if (
auto *CleanupRet = dyn_cast<CleanupReturnInst>(BB->getTerminator()))
1958 if (CleanupRet->unwindsToCaller() && EHPadForCallUnwindsLocally)
1965 if (
auto *CatchSwitch = dyn_cast<CatchSwitchInst>(I)) {
1966 if (isa<ConstantTokenNone>(CatchSwitch->getParentPad()))
1967 CatchSwitch->setParentPad(CallSiteEHPad);
1969 auto *FPI = cast<FuncletPadInst>(
I);
1970 if (isa<ConstantTokenNone>(FPI->getParentPad()))
1971 FPI->setParentPad(CallSiteEHPad);
1976 if (InlinedDeoptimizeCalls) {
1986 Returns.
erase(NewEnd, Returns.
end());
1990 Caller->
getParent(), Intrinsic::experimental_deoptimize,
2017 "Expected at least the deopt operand bundle");
2021 Builder.CreateCall(NewDeoptIntrinsic, CallArgs, OpBundles);
2024 Builder.CreateRetVoid();
2026 Builder.CreateRet(NewDeoptCall);
2038 if (InlinedMustTailCalls) {
2041 bool NeedBitCast = !TheCall->
use_empty() && TheCall->
getType() != NewRetTy;
2048 if (!ReturnedMustTail) {
2057 auto *OldCast = dyn_cast_or_null<BitCastInst>(RI->getReturnValue());
2060 OldCast->eraseFromParent();
2088 if (Returns.
size() == 1 && std::distance(FirstNewBlock, Caller->
end()) == 1) {
2091 FirstNewBlock->getInstList(),
2092 FirstNewBlock->begin(), FirstNewBlock->end());
2098 if (
InvokeInst *II = dyn_cast<InvokeInst>(TheCall)) {
2116 Returns[0]->eraseFromParent();
2129 BranchInst *CreatedBranchToNormalDest =
nullptr;
2130 if (
InvokeInst *II = dyn_cast<InvokeInst>(TheCall)) {
2140 CalledFunc->
getName() +
".exit");
2147 CalledFunc->
getName() +
".exit");
2161 "splitBasicBlock broken!");
2176 if (Returns.
size() > 1) {
2181 &AfterCallBB->
front());
2190 for (
unsigned i = 0, e = Returns.
size(); i != e; ++i) {
2193 "Ret value not consistent in function!");
2200 for (
unsigned i = 0, e = Returns.
size(); i != e; ++i) {
2211 if (CreatedBranchToNormalDest)
2213 }
else if (!Returns.
empty()) {
2217 if (TheCall == Returns[0]->getReturnValue())
2224 BasicBlock *ReturnBB = Returns[0]->getParent();
2232 if (CreatedBranchToNormalDest)
2233 CreatedBranchToNormalDest->
setDebugLoc(Returns[0]->getDebugLoc());
2236 Returns[0]->eraseFromParent();
2254 assert(cast<BranchInst>(Br)->isUnconditional() &&
"splitBasicBlock broken!");
2255 BasicBlock *CalleeEntry = cast<BranchInst>(Br)->getSuccessor(0);
Return a value (possibly void), from a function.
const Value * getCalledValue() const
Get a pointer to the function that is invoked by this instruction.
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
void push_back(const T &Elt)
A parsed version of the target data layout string in and methods for querying it. ...
bool replaceDbgDeclareForAlloca(AllocaInst *AI, Value *NewAllocaAddress, DIBuilder &Builder, bool Deref, int Offset=0)
Replaces llvm.dbg.declare instruction when the alloca it describes is replaced with a new value...
FunTy * getCaller() const
Return the caller function for this call site.
void removePredecessor(BasicBlock *Pred, bool DontDeleteUselessPHIs=false)
Notify the BasicBlock that the predecessor Pred is no longer able to reach it.
void addIncoming(Value *V, BasicBlock *BB)
Add an incoming value to the end of the PHI list.
static cl::opt< bool > EnableNoAliasConversion("enable-noalias-to-md-conversion", cl::init(true), cl::Hidden, cl::desc("Convert noalias attributes to metadata during inlining."))
unsigned getOrEnforceKnownAlignment(Value *V, unsigned PrefAlign, const DataLayout &DL, const Instruction *CxtI=nullptr, AssumptionCache *AC=nullptr, const DominatorTree *DT=nullptr)
Try to ensure that the alignment of V is at least PrefAlign bytes.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
void getOperandBundlesAsDefs(SmallVectorImpl< OperandBundleDef > &Defs) const
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
unsigned getNumOperandBundles() const
This class represents an incoming formal argument to a Function.
iterator erase(iterator where)
CallGraph * CG
CG - If non-null, InlineFunction will update the callgraph to reflect the changes it makes...
bool onlyReadsMemory() const
Determine if the function does not access or only reads memory.
A Module instance is used to store all the information related to an LLVM module. ...
Constant * getClause(unsigned Idx) const
Get the value of the clause at index Idx.
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
auto remove_if(R &&Range, UnaryPredicate P) -> decltype(std::begin(Range))
Provide wrappers to std::remove_if which take ranges instead of having to pass begin/end explicitly...
an instruction that atomically checks whether a specified value is in a memory location, and, if it is, stores a new value there.
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs, and aliases.
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
std::function< AssumptionCache &(Function &)> * GetAssumptionCache
unsigned getNumOperands() const
Return number of MDNode operands.
unsigned getPrefTypeAlignment(Type *Ty) const
Returns the preferred stack/global alignment for the specified type.
Analysis providing profile information.
This class represents a function call, abstracting a target machine's calling convention.
bool isIntrinsic() const
isIntrinsic - Returns true if the function's name starts with "llvm.".
void setGC(std::string Str)
const CallInst * getTerminatingDeoptimizeCall() const
Returns the call instruction calling .experimental.deoptimize prior to the terminating return instruc...
static void updateCalleeCount(BlockFrequencyInfo *CallerBFI, BasicBlock *CallBB, Instruction *CallInst, Function *Callee, ProfileSummaryInfo *PSI)
Update the entry count of callee after inlining.
A cache of .assume calls within a function.
static void AddAlignmentAssumptions(CallSite CS, InlineFunctionInfo &IFI)
If the inlined function has non-byval align arguments, then add .assume-based alignment assumptions t...
const CallInst * getTerminatingMustTailCall() const
Returns the call instruction marked 'musttail' prior to the terminating return instruction of this ba...
const Function * getParent() const
Return the enclosing method, or null if none.
Optional< uint64_t > getProfileCount(const Instruction *CallInst, BlockFrequencyInfo *BFI)
Returns the profile count for CallInst.
const Instruction & front() const
An instruction for reading from memory.
static void AddAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap, const DataLayout &DL, AAResults *CalleeAAR)
If the inlined function has noalias arguments, then add new alias scopes for each noalias argument...
static IntegerType * getInt64Ty(LLVMContext &C)
uint64_t getFrequency() const
Returns the frequency as a fixpoint number scaled by the entry frequency.
an instruction that atomically reads a memory location, combines it with another value, and then stores the result back.
void GetUnderlyingObjects(Value *V, SmallVectorImpl< Value * > &Objects, const DataLayout &DL, LoopInfo *LI=nullptr, unsigned MaxLookup=6)
This method is similar to GetUnderlyingObject except that it can look through phi and select instruct...
Type * getElementType() const
void reserve(size_type N)
unsigned changeToUnreachable(Instruction *I, bool UseLLVMTrap, bool PreserveLCSSA=false)
Insert an unreachable instruction before the specified instruction, making it and the rest of the cod...
InlineFunctionInfo - This class captures the data input to the InlineFunction call, and records the auxiliary results produced by it.
iterator end()
Get an iterator to the end of the SetVector.
A node in the call graph for a module.
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
unsigned arg_size() const
StringRef getName() const
Return a constant reference to the value's name.
static void fixupLineNumbers(Function *Fn, Function::iterator FI, Instruction *TheCall, bool CalleeHasDebugInfo)
Update inlined instructions' line numbers to to encode location where these instructions are inlined...
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
iterator begin()
Instruction iterator methods.
void setCallingConv(CallingConv::ID CC)
bool InlineFunction(CallInst *C, InlineFunctionInfo &IFI, AAResults *CalleeAAR=nullptr, bool InsertLifetime=true)
InlineFunction - This function inlines the called function into the basic block of the caller...
static void updateCallProfile(Function *Callee, const ValueToValueMapTy &VMap, const Optional< uint64_t > &CalleeEntryCount, const Instruction *TheCall, ProfileSummaryInfo *PSI, BlockFrequencyInfo *CallerBFI)
Update the branch metadata for cloned call instructions.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
void addCalledFunction(CallSite CS, CallGraphNode *M)
Adds a function to the list of functions called by this one.
std::vector< CallRecord >::iterator iterator
void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc, ValueToValueMapTy &VMap, bool ModuleLevelChanges, SmallVectorImpl< ReturnInst * > &Returns, const char *NameSuffix="", ClonedCodeInfo *CodeInfo=nullptr, Instruction *TheCall=nullptr)
CloneAndPruneFunctionInto - This works exactly like CloneFunctionInto, except that it does some simpl...
bool hasGC() const
hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm to use during code generatio...
Value * getReturnValue() const
Convenience accessor. Returns null if there is no return value.
DILocation * get() const
Get the underlying DILocation.
static void HandleInlinedLandingPad(InvokeInst *II, BasicBlock *FirstNewBlock, ClonedCodeInfo &InlinedCodeInfo)
If we inlined an invoke site, we need to convert calls in the body of the inlined function into invok...
const Constant * stripPointerCasts() const
A Use represents the edge between a Value definition and its users.
ValTy * getCalledValue() const
Return the pointer to function that is being called.
static void updateCallerBFI(BasicBlock *CallSiteBlock, const ValueToValueMapTy &VMap, BlockFrequencyInfo *CallerBFI, BlockFrequencyInfo *CalleeBFI, const BasicBlock &CalleeEntryBlock)
Update the block frequencies of the caller after a callee has been inlined.
ReturnInst * CreateRet(Value *V)
Create a 'ret <val>' instruction.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
bool isCall() const
Return true if a CallInst is enclosed.
Constant * getPersonalityFn() const
Get the personality function associated with this function.
This file contains the simple types necessary to represent the attributes associated with functions a...
static void CloneAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap)
When inlining a function that contains noalias scope metadata, this metadata needs to be cloned so th...
bool isMustTailCall() const
The only memory references in this function (if it has any) are non-volatile loads from objects point...
void setBlockFreqAndScale(const BasicBlock *ReferenceBB, uint64_t Freq, SmallPtrSetImpl< BasicBlock * > &BlocksToScale)
Set the frequency of ReferenceBB to Freq and scale the frequencies of the blocks in BlocksToScale suc...
LandingPadInst * getLandingPadInst() const
Get the landingpad instruction from the landing pad block (the unwind destination).
LLVM_NODISCARD bool empty() const
bool doesNotThrow() const
Determine if the call cannot unwind.
void addHandler(BasicBlock *Dest)
Add an entry to the switch instruction...
This file provides interfaces used to build and manipulate a call graph, which is a very useful tool ...
static void UpdateCallGraphAfterInlining(CallSite CS, Function::iterator FirstNewBlock, ValueToValueMapTy &VMap, InlineFunctionInfo &IFI)
Once we have cloned code over from a callee into the caller, update the specified callgraph to reflec...
Value * CreateBitCast(Value *V, Type *DestTy, const Twine &Name="")
std::vector< WeakTrackingVH > OperandBundleCallSites
All cloned call sites that have operand bundles attached are appended to this vector.
bool insert(const value_type &X)
Insert a new element into the SetVector.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
op_iterator arg_begin()
Return the iterator pointing to the beginning of the argument list.
const T & getValue() const LLVM_LVALUE_FUNCTION
FunctionModRefBehavior
Summary of how a function affects memory in the program.
iterator find(const KeyT &Val)
iterator begin()
Get an iterator to the beginning of the SetVector.
bool empty() const
Determine if the SetVector is empty or not.
BlockFrequencyInfo * CalleeBFI
static std::string utostr(uint64_t X, bool isNeg=false)
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
unsigned getNumClauses() const
Get the number of clauses for this landing pad.
const Function * getFunction() const
Return the function this instruction belongs to.
An instruction for storing to memory.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
Optional< uint64_t > getEntryCount() const
Get the entry count for this function.
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Return a temporary node.
void takeName(Value *V)
Transfer the name from V to this value.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
static unsigned getKnownAlignment(Value *V, const DataLayout &DL, const Instruction *CxtI=nullptr, AssumptionCache *AC=nullptr, const DominatorTree *DT=nullptr)
Try to infer an alignment for the specified pointer.
BasicBlock * getNormalDest() const
Class to represent pointers.
bool mayReadOrWriteMemory() const
Return true if this instruction may read or write memory.
static BasicBlock * HandleCallsInBlockInlinedThroughInvoke(BasicBlock *BB, BasicBlock *UnwindEdge, UnwindDestMemoTy *FuncletUnwindMap=nullptr)
When we inline a basic block into an invoke, we have to turn all of the calls that can throw into inv...
bool hasOperandBundles() const
static bool isUsedByLifetimeMarker(Value *V)
void getOperandBundlesAsDefs(SmallVectorImpl< OperandBundleDef > &Defs) const
Return the list of operand bundles attached to this instruction as a vector of OperandBundleDefs.
iterator find(const_arg_type_t< KeyT > Val)
static cl::opt< bool > PreserveAlignmentAssumptions("preserve-alignment-assumptions-during-inlining", cl::init(true), cl::Hidden, cl::desc("Convert align attributes to assumptions during inlining."))
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
void setCallingConv(CallingConv::ID CC)
Type * getReturnType() const
Returns the type of the ret val.
SmallVector< CallSite, 8 > InlinedCallSites
All of the new call sites inlined into the caller.
initializer< Ty > init(const Ty &Val)
The landingpad instruction holds all of the information necessary to generate correct exception handl...
Optional< OperandBundleUse > getOperandBundle(StringRef Name) const
Subclasses of this class are all able to terminate a basic block.
void setDebugLoc(DebugLoc Loc)
Set the debug location information for this instruction.
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
FunctionType * getFunctionType() const
Returns the FunctionType for me.
Conditional or Unconditional Branch instruction.
This is an important base class in LLVM.
PointerType * getType() const
Overload to return most specific pointer type.
Resume the propagation of an exception.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
unsigned getParamAlignment(unsigned ArgNo) const
Extract the alignment for a call or parameter (0=unknown).
Interval::pred_iterator pred_begin(Interval *I)
pred_begin/pred_end - define methods so that Intervals may be used just like BasicBlocks can with the...
bool hasPersonalityFn() const
Check whether this function has a personality function.
unsigned getAllocaAddrSpace() const
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.
EHPersonality classifyEHPersonality(const Value *Pers)
See if the given exception handling personality function is one that we understand.
FunctionModRefBehavior getModRefBehavior(ImmutableCallSite CS)
Return the behavior of the given call site.
void splice(iterator where, iplist_impl &L2)
static Value * getUnwindDestTokenHelper(Instruction *EHPad, UnwindDestMemoTy &MemoMap)
Helper for getUnwindDestToken that does the descendant-ward part of the search.
const InstListType & getInstList() const
Return the underlying instruction list container.
bool isUsedWithInAlloca() const
Return true if this alloca is used as an inalloca argument to a call.
bool isByValArgument(unsigned ArgNo) const
Determine whether this argument is passed by value.
static bool hasLifetimeMarkers(AllocaInst *AI)
The only memory references in this function (if it has any) are non-volatile loads and stores from ob...
Value * getOperand(unsigned i) const
Interval::pred_iterator pred_end(Interval *I)
self_iterator getIterator()
op_iterator arg_end()
Return the iterator pointing to the end of the argument list.
uint32_t getTagID() const
Return the tag of this operand bundle as an integer.
void setTailCallKind(TailCallKind TCK)
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
This class represents the va_arg llvm instruction, which returns an argument of the specified type gi...
iterator erase(const_iterator CI)
LLVMContext & getContext() const
All values hold a context through their type.
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
void setMetadata(unsigned KindID, MDNode *Node)
Set the metadata of the specified kind to the specified node.
OperandBundleUse getOperandBundleAt(unsigned Index) const
bool isIdentifiedFunctionLocal(const Value *V)
Return true if V is umabigously identified at the function-level.
static void UpdatePHINodes(BasicBlock *OrigBB, BasicBlock *NewBB, ArrayRef< BasicBlock * > Preds, BranchInst *BI, bool HasLoopExit)
Update the PHI nodes in OrigBB to include the values coming from NewBB.
static InvokeInst * Create(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.
void setEntryCount(uint64_t Count, const DenseSet< GlobalValue::GUID > *Imports=nullptr)
Set the entry count for this function.
static void HandleByValArgumentInit(Value *Dst, Value *Src, Module *M, BasicBlock *InsertBlock, InlineFunctionInfo &IFI)
const MDOperand & getOperand(unsigned I) const
A SetVector that performs no allocations if smaller than a certain size.
Iterator for intrusive lists based on ilist_node.
const BasicBlockListType & getBasicBlockList() const
Get the underlying elements of the Function...
BasicBlock * getUnwindDest() const
bool isSwiftError() const
Return true if this alloca is used as a swifterror argument to a call.
This is the shared class of boolean and integer constants.
InstrTy * getInstruction() const
static CatchSwitchInst * Create(Value *ParentPad, BasicBlock *UnwindDest, unsigned NumHandlers, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Optional< OperandBundleUse > getOperandBundle(StringRef Name) const
Return an operand bundle by name, if present.
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
bool isFuncletEHPersonality(EHPersonality Pers)
Returns true if this is a personality function that invokes handler funclets (which must return to it...
ValTy * getArgument(unsigned ArgNo) const
static CallInst * Create(Value *Func, ArrayRef< Value * > Args, ArrayRef< OperandBundleDef > Bundles=None, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Module.h This file contains the declarations for the Module class.
Type * getType() const
All values are typed, get the type of this value.
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
TailCallKind getTailCallKind() const
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
void setBlockFreq(const BasicBlock *BB, uint64_t Freq)
LLVM_NODISCARD T pop_back_val()
static Value * getParentPad(Value *EHPad)
Helper for getUnwindDestToken/getUnwindDestTokenHelper.
static Value * getUnwindDestToken(Instruction *EHPad, UnwindDestMemoTy &MemoMap)
Given an EH pad, find where it unwinds.
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.
Function * getCalledFunction() const
Return the function called, or null if this is an indirect function invocation.
static BranchInst * Create(BasicBlock *IfTrue, Instruction *InsertBefore=nullptr)
static PHINode * Create(Type *Ty, unsigned NumReservedValues, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructors - NumReservedValues is a hint for the number of incoming edges that this phi node will h...
const BasicBlock & getEntryBlock() const
DenseMap< Instruction *, Value * > UnwindDestMemoTy
void setOperand(unsigned i, Value *Val)
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
DISubprogram * getSubprogram() const
Get the attached subprogram.
Value * getIncomingValueForBlock(const BasicBlock *BB) const
iterator_range< user_iterator > users()
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
llvm_unreachable("Unknown RegBank!")
bool ContainsCalls
ContainsCalls - This is set to true if the cloned code contains a normal call instruction.
bool isEHPad() const
Return true if the instruction is a variety of EH-block.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
SmallVector< AllocaInst *, 4 > StaticAllocas
StaticAllocas - InlineFunction fills this in with all static allocas that get copied into the caller...
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
The basic data container for the call graph of a Module of IR.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
void emplace_back(ArgTypes &&...Args)
void registerAssumption(CallInst *CI)
Add an .assume intrinsic to this function's cache.
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
SmallVector< WeakTrackingVH, 8 > InlinedCalls
InlinedCalls - InlineFunction fills this in with callsites that were inlined from the callee...
Establish a view to a call site for examination.
static MDNode * concatenate(MDNode *A, MDNode *B)
Methods for metadata merging.
const std::string & getGC() const
static void PropagateParallelLoopAccessMetadata(CallSite CS, ValueToValueMapTy &VMap)
When inlining a call site that has !llvm.mem.parallel_loop_access metadata, that metadata should be p...
SymbolTableList< BasicBlock >::iterator eraseFromParent()
Unlink 'this' from the containing function and delete it.
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
static Value * HandleByValArgument(Value *Arg, Instruction *TheCall, const Function *CalledFunc, InlineFunctionInfo &IFI, unsigned ByValAlignment)
When inlining a call site that has a byval argument, we have to make the implicit memcpy explicit by ...
ClonedCodeInfo - This struct can be used to capture information about code being cloned, while it is being cloned.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
static ConstantTokenNone * get(LLVMContext &Context)
Return the ConstantTokenNone.
BasicBlock * splitBasicBlock(iterator I, const Twine &BBName="")
Split the basic block into two basic blocks at the specified instruction.
LLVMContext & getContext() const
uint64_t getTypeStoreSize(Type *Ty) const
Returns the maximum number of bytes that may be overwritten by storing the specified type...
bool PointerMayBeCapturedBefore(const Value *V, bool ReturnCaptures, bool StoreCaptures, const Instruction *I, DominatorTree *DT, bool IncludeI=false, OrderedBasicBlock *OBB=nullptr)
PointerMayBeCapturedBefore - Return true if this pointer value may be captured by the enclosing funct...
static bool allocaWouldBeStaticInEntry(const AllocaInst *AI)
Return the result of AI->isStaticAlloca() if AI were moved to the entry block.
BlockFrequencyInfo * CallerBFI
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool ContainsDynamicAllocas
ContainsDynamicAllocas - This is set to true if the cloned code contains a 'dynamic' alloca...
bool isAsynchronousEHPersonality(EHPersonality Pers)
Returns true if this personality function catches asynchronous exceptions.
const BasicBlock & front() const
FunTy * getCalledFunction() const
Return the function being called if this is a direct call, otherwise return null (if it's an indirect...
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
A vector that has set insertion semantics.
void removeCallEdgeFor(CallSite CS)
Removes the edge in the node for the specified call site.
static CleanupReturnInst * Create(Value *CleanupPad, BasicBlock *UnwindBB=nullptr, Instruction *InsertBefore=nullptr)
const Value * getArraySize() const
Get the number of elements allocated.
void recalculate(FT &F)
recalculate - compute a dominator tree for the given function
BasicBlock * changeToInvokeAndSplitBasicBlock(CallInst *CI, BasicBlock *UnwindEdge)
Convert the CallInst to InvokeInst with the specified unwind edge basic block.
bool isCleanup() const
Return 'true' if this landingpad instruction is a cleanup.
std::vector< CallRecord > CalledFunctionsVector
void setPersonalityFn(Constant *Fn)
const TerminatorInst * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
static void HandleInlinedEHPad(InvokeInst *II, BasicBlock *FirstNewBlock, ClonedCodeInfo &InlinedCodeInfo)
If we inlined an invoke site, we need to convert calls in the body of the inlined function into invok...
static DebugLoc appendInlinedAt(DebugLoc DL, DILocation *InlinedAt, LLVMContext &Ctx, DenseMap< const MDNode *, MDNode * > &Cache, bool ReplaceLast=false)
Rebuild the entire inlined-at chain for this instruction so that the top of the chain now is inlined-...
const Instruction * getFirstNonPHI() const
Returns a pointer to the first instruction in this block that is not a PHINode instruction.
Type * getAllocatedType() const
Return the type that is being allocated by the instruction.
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
Value * SimplifyInstruction(Instruction *I, const SimplifyQuery &Q, OptimizationRemarkEmitter *ORE=nullptr)
See if we can compute a simplified version of this instruction.
const BasicBlock * getParent() const
bool doesNotThrow() const
Determine if the call cannot unwind.
iterator_range< arg_iterator > args()
A wrapper class for inspecting calls to intrinsic functions.
bool isVoidTy() const
Return true if this is 'void'.
an instruction to allocate memory on the stack
BlockFrequency getBlockFreq(const BasicBlock *BB) const
getblockFreq - Return block frequency.