Home
last modified time | relevance | path

Searched refs:CB (Results 1 – 25 of 383) sorted by relevance

12345678910>>...16

/freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/
H A DCallSiteSplitting.cpp86 static void addNonNullAttribute(CallBase &CB, Value *Op) { in addNonNullAttribute() argument
88 for (auto &I : CB.args()) { in addNonNullAttribute()
90 CB.addParamAttr(ArgNo, Attribute::NonNull); in addNonNullAttribute()
95 static void setConstantInArgument(CallBase &CB, Value *Op, in setConstantInArgument() argument
98 for (auto &I : CB.args()) { in setConstantInArgument()
102 CB.removeParamAttr(ArgNo, Attribute::NonNull); in setConstantInArgument()
103 CB.setArgOperand(ArgNo, ConstValue); in setConstantInArgument()
109 static bool isCondRelevantToAnyCallArgument(ICmpInst *Cmp, CallBase &CB) { in isCondRelevantToAnyCallArgument() argument
113 for (auto I = CB.arg_begin(), E = CB.arg_end(); I != E; ++I, ++ArgNo) { in isCondRelevantToAnyCallArgument()
115 if (isa<Constant>(*I) || CB.paramHasAttr(ArgNo, Attribute::NonNull)) in isCondRelevantToAnyCallArgument()
[all …]
/freebsd/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/
H A DUnreachableCodeChecker.cpp40 static inline const Stmt *getUnreachableStmt(const CFGBlock *CB);
41 static void FindUnreachableEntryPoints(const CFGBlock *CB,
44 static bool isInvalidPath(const CFGBlock *CB, const ParentMap &PM);
45 static inline bool isEmptyCFGBlock(const CFGBlock *CB);
78 const CFGBlock *CB = BE->getBlock(); in checkEndAnalysis() local
79 reachable.insert(CB->getBlockID()); in checkEndAnalysis()
95 for (const CFGBlock *CB : *C) { in checkEndAnalysis()
97 if (reachable.count(CB->getBlockID())) in checkEndAnalysis()
101 if (isEmptyCFGBlock(CB)) in checkEndAnalysis()
105 if (!visited.count(CB->getBlockID())) in checkEndAnalysis()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/CFGuard/
H A DCFGuard.cpp99 void insertCFGuardCheck(CallBase *CB);
140 void insertCFGuardDispatch(CallBase *CB);
172 void CFGuardImpl::insertCFGuardCheck(CallBase *CB) { in insertCFGuardCheck() argument
174 assert(Triple(CB->getModule()->getTargetTriple()).isOSWindows() && in insertCFGuardCheck()
176 assert(CB->isIndirectCall() && in insertCFGuardCheck()
179 IRBuilder<> B(CB); in insertCFGuardCheck()
180 Value *CalledOperand = CB->getCalledOperand(); in insertCFGuardCheck()
185 if (auto Bundle = CB->getOperandBundle(LLVMContext::OB_funclet)) in insertCFGuardCheck()
201 void CFGuardImpl::insertCFGuardDispatch(CallBase *CB) { in insertCFGuardDispatch() argument
203 assert(Triple(CB->getModule()->getTargetTriple()).isOSWindows() && in insertCFGuardDispatch()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/
H A DCallPromotionUtils.cpp166 static void createRetBitCast(CallBase &CB, Type *RetTy, CastInst **RetBitCast) { in createRetBitCast() argument
170 SmallVector<User *, 16> UsersToUpdate(CB.users()); in createRetBitCast()
175 if (auto *Invoke = dyn_cast<InvokeInst>(&CB)) in createRetBitCast()
179 InsertBefore = std::next(CB.getIterator()); in createRetBitCast()
182 auto *Cast = CastInst::CreateBitOrPointerCast(&CB, RetTy, "", InsertBefore); in createRetBitCast()
188 U->replaceUsesOfWith(&CB, Cast); in createRetBitCast()
285 static CallBase &versionCallSiteWithCond(CallBase &CB, Value *Cond, in versionCallSiteWithCond() argument
288 IRBuilder<> Builder(&CB); in versionCallSiteWithCond()
289 CallBase *OrigInst = &CB; in versionCallSiteWithCond()
296 SplitBlockAndInsertIfThen(Cond, &CB, false, BranchWeights); in versionCallSiteWithCond()
[all …]
H A DInlineFunction.cpp884 propagateMemProfMetadata(Function *Callee, CallBase &CB, in propagateMemProfMetadata() argument
887 MDNode *CallsiteMD = CB.getMetadata(LLVMContext::MD_callsite); in propagateMemProfMetadata()
916 static void PropagateCallSiteMetadata(CallBase &CB, Function::iterator FStart, in PropagateCallSiteMetadata() argument
919 CB.getMetadata(LLVMContext::MD_mem_parallel_loop_access); in PropagateCallSiteMetadata()
920 MDNode *AccessGroup = CB.getMetadata(LLVMContext::MD_access_group); in PropagateCallSiteMetadata()
921 MDNode *AliasScope = CB.getMetadata(LLVMContext::MD_alias_scope); in PropagateCallSiteMetadata()
922 MDNode *NoAlias = CB.getMetadata(LLVMContext::MD_noalias); in PropagateCallSiteMetadata()
1095 static void AddAliasScopeMetadata(CallBase &CB, ValueToValueMapTy &VMap, in AddAliasScopeMetadata() argument
1101 const Function *CalledFunc = CB.getCalledFunction(); in AddAliasScopeMetadata()
1105 if (CB.paramHasAttr(Arg.getArgNo(), Attribute::NoAlias) && !Arg.use_empty()) in AddAliasScopeMetadata()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Analysis/
H A DInlineAdvisor.cpp74 MandatoryInlineAdvice(InlineAdvisor *Advisor, CallBase &CB, in MandatoryInlineAdvice() argument
77 : InlineAdvice(Advisor, CB, ORE, IsInliningMandatory) {} in MandatoryInlineAdvice()
136 CallBase &CB, FunctionAnalysisManager &FAM, const InlineParams &Params) { in getDefaultInlineAdvice() argument
137 Function &Caller = *CB.getCaller(); in getDefaultInlineAdvice()
141 *CB.getParent()->getParent()->getParent()); in getDefaultInlineAdvice()
154 auto GetInlineCost = [&](CallBase &CB) { in getDefaultInlineAdvice() argument
155 Function &Callee = *CB.getCalledFunction(); in getDefaultInlineAdvice()
160 return getInlineCost(CB, Params, CalleeTTI, GetAssumptionCache, GetTLI, in getDefaultInlineAdvice()
164 CB, GetInlineCost, ORE, in getDefaultInlineAdvice()
169 DefaultInlineAdvisor::getAdviceImpl(CallBase &CB) { in getAdviceImpl() argument
[all …]
H A DInlineOrder.cpp45 llvm::InlineCost getInlineCostWrapper(CallBase &CB, in getInlineCostWrapper() argument
48 Function &Caller = *CB.getCaller(); in getInlineCostWrapper()
52 *CB.getParent()->getParent()->getParent()); in getInlineCostWrapper()
65 Function &Callee = *CB.getCalledFunction(); in getInlineCostWrapper()
70 return getInlineCost(CB, Params, CalleeTTI, GetAssumptionCache, GetTLI, in getInlineCostWrapper()
77 SizePriority(const CallBase *CB, FunctionAnalysisManager &, in SizePriority() argument
79 Function *Callee = CB->getCalledFunction(); in SizePriority()
94 CostPriority(const CallBase *CB, FunctionAnalysisManager &FAM, in CostPriority() argument
96 auto IC = getInlineCostWrapper(const_cast<CallBase &>(*CB), FAM, Params); in CostPriority()
114 CostBenefitPriority(const CallBase *CB, FunctionAnalysisManager &FAM, in CostBenefitPriority() argument
[all …]
H A DMLInlineAdvisor.cpp342 std::unique_ptr<InlineAdvice> MLInlineAdvisor::getAdviceImpl(CallBase &CB) { in getAdviceImpl() argument
343 if (auto Skip = getSkipAdviceIfUnreachableCallsite(CB)) in getAdviceImpl()
346 auto &Caller = *CB.getCaller(); in getAdviceImpl()
347 auto &Callee = *CB.getCalledFunction(); in getAdviceImpl()
357 return std::make_unique<InlineAdvice>(this, CB, ORE, in getAdviceImpl()
358 GetDefaultAdvice(CB)); in getAdviceImpl()
360 auto MandatoryKind = InlineAdvisor::getMandatoryKind(CB, FAM, ORE); in getAdviceImpl()
367 return getMandatoryAdvice(CB, false); in getAdviceImpl()
376 return OptimizationRemarkMissed(DEBUG_TYPE, "ForceStop", &CB) in getAdviceImpl()
379 return std::make_unique<InlineAdvice>(this, CB, ORE, Mandatory); in getAdviceImpl()
[all …]
H A DReplayInlineAdvisor.cpp93 std::unique_ptr<InlineAdvice> ReplayInlineAdvisor::getAdviceImpl(CallBase &CB) { in getAdviceImpl() argument
96 Function &Caller = *CB.getCaller(); in getAdviceImpl()
100 if (!hasInlineAdvice(*CB.getFunction())) { in getAdviceImpl()
103 return OriginalAdvisor->getAdvice(CB); in getAdviceImpl()
110 formatCallSiteLocation(CB.getDebugLoc(), ReplaySettings.ReplayFormat); in getAdviceImpl()
111 StringRef Callee = CB.getCalledFunction()->getName(); in getAdviceImpl()
121 this, CB, llvm::InlineCost::getAlways("previously inlined"), ORE, in getAdviceImpl()
127 return std::make_unique<DefaultInlineAdvice>(this, CB, std::nullopt, ORE, in getAdviceImpl()
136 this, CB, llvm::InlineCost::getAlways("AlwaysInline Fallback"), ORE, in getAdviceImpl()
141 return std::make_unique<DefaultInlineAdvice>(this, CB, std::nullopt, ORE, in getAdviceImpl()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Target/X86/MCTargetDesc/
H A DX86MCCodeEmitter.cpp41 static void emitByte(uint8_t C, SmallVectorImpl<char> &CB) { CB.push_back(C); } in emitByte() argument
295 void emit(SmallVectorImpl<char> &CB) const { in emit()
303 emitByte(0x40 | W << 3 | R << 2 | X << 1 | B, CB); in emit()
306 emitByte(0xD5, CB); in emit()
309 CB); in emit()
312 emitByte(0xC5, CB); in emit()
313 emitByte(((~R) & 1) << 7 | LastPayload, CB); in emit()
317 emitByte(Kind == VEX3 ? 0xC4 : 0x8F, CB); in emit()
318 emitByte(FirstPayload | VEX_5M, CB); in emit()
319 emitByte(W << 7 | LastPayload, CB); in emit()
[all …]
/freebsd/contrib/llvm-project/llvm/include/llvm/IR/
H A DAbstractCallSite.h76 CallBase *CB;
105 static void getCallbackUses(const CallBase &CB,
109 explicit operator bool() const { return CB != nullptr; }
112 CallBase *getInstruction() const { return CB; } in getInstruction()
116 return !isCallbackCall() && !CB->isIndirectCall(); in isDirectCall()
121 return !isCallbackCall() && CB->isIndirectCall(); in isIndirectCall()
139 return CB->isCallee(U); in isCallee()
150 return (int)CB->getArgOperandNo(U) == CI.ParameterEncoding[0]; in isCallee()
156 return CB->arg_size(); in getNumArgOperands()
185 return CB->getArgOperand(ArgNo); in getCallArgOperand()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/IPO/
H A DDeadArgumentElimination.cpp89 bool isMustTailCalleeAnalyzable(const CallBase &CB) { in isMustTailCalleeAnalyzable() argument
90 assert(CB.isMustTailCall()); in isMustTailCalleeAnalyzable()
91 return CB.getCalledFunction() && !CB.getCalledFunction()->isDeclaration(); in isMustTailCalleeAnalyzable()
184 CallBase *CB = dyn_cast<CallBase>(U); in deleteDeadVarargs() local
185 if (!CB) in deleteDeadVarargs()
189 Args.assign(CB->arg_begin(), CB->arg_begin() + NumArgs); in deleteDeadVarargs()
192 AttributeList PAL = CB->getAttributes(); in deleteDeadVarargs()
202 CB->getOperandBundlesAsDefs(OpBundles); in deleteDeadVarargs()
205 if (InvokeInst *II = dyn_cast<InvokeInst>(CB)) { in deleteDeadVarargs()
207 Args, OpBundles, "", CB->getIterator()); in deleteDeadVarargs()
[all …]
H A DArgumentPromotion.cpp211 CallBase &CB = cast<CallBase>(*F->user_back()); in doPromotion() local
212 assert(CB.getCalledFunction() == F); in doPromotion()
213 const AttributeList &CallPAL = CB.getAttributes(); in doPromotion()
214 IRBuilder<NoFolder> IRB(&CB); in doPromotion()
218 auto *AI = CB.arg_begin(); in doPromotion()
259 for (; AI != CB.arg_end(); ++AI, ++ArgNo) { in doPromotion()
265 CB.getOperandBundlesAsDefs(OpBundles); in doPromotion()
268 if (InvokeInst *II = dyn_cast<InvokeInst>(&CB)) { in doPromotion()
270 Args, OpBundles, "", CB.getIterator()); in doPromotion()
273 CallInst::Create(NF, Args, OpBundles, "", CB.getIterator()); in doPromotion()
[all …]
H A DModuleInliner.cpp148 if (auto *CB = dyn_cast<CallBase>(&I)) in run() local
149 if (Function *Callee = CB->getCalledFunction()) { in run()
151 Calls->push({CB, -1}); in run()
154 setInlineRemark(*CB, "unavailable definition"); in run()
158 << NV("Caller", CB->getCaller()) in run()
181 CallBase *CB = P.first; in run() local
183 Function &F = *CB->getCaller(); in run()
184 Function &Callee = *CB->getCalledFunction(); in run()
197 setInlineRemark(*CB, "recursive"); in run()
201 auto Advice = Advisor.getAdvice(*CB, /*OnlyMandatory*/ false); in run()
[all …]
H A DExpandVariadics.cpp189 bool expandCall(Module &M, IRBuilder<> &Builder, CallBase *CB, FunctionType *,
271 bool expansionApplicableToFunctionCall(CallBase *CB) { in expansionApplicableToFunctionCall() argument
272 if (CallInst *CI = dyn_cast<CallInst>(CB)) { in expansionApplicableToFunctionCall()
284 if (isa<InvokeInst>(CB)) { in expansionApplicableToFunctionCall()
405 if (CallBase *CB = dyn_cast<CallBase>(&I)) { in runOnModule() local
406 if (CB->isIndirectCall()) { in runOnModule()
407 FunctionType *FTy = CB->getFunctionType(); in runOnModule()
409 Changed |= expandCall(M, Builder, CB, FTy, 0); in runOnModule()
458 if (CallBase *CB = dyn_cast<CallBase>(U)) { in runOnFunction() local
459 Value *CalledOperand = CB->getCalledOperand(); in runOnFunction()
[all …]
H A DAlwaysInliner.cpp52 if (auto *CB = dyn_cast<CallBase>(U)) in AlwaysInlineImpl() local
53 if (CB->getCalledFunction() == &F && in AlwaysInlineImpl()
54 CB->hasFnAttr(Attribute::AlwaysInline) && in AlwaysInlineImpl()
55 !CB->getAttributes().hasFnAttr(Attribute::NoInline)) in AlwaysInlineImpl()
56 Calls.insert(CB); in AlwaysInlineImpl()
58 for (CallBase *CB : Calls) { in AlwaysInlineImpl()
59 Function *Caller = CB->getCaller(); in AlwaysInlineImpl()
61 DebugLoc DLoc = CB->getDebugLoc(); in AlwaysInlineImpl()
62 BasicBlock *Block = CB->getParent(); in AlwaysInlineImpl()
68 InlineResult Res = InlineFunction(*CB, IFI, /*MergeAttributes=*/true, in AlwaysInlineImpl()
H A DFunctionAttrs.cpp538 CallBase *CB = dyn_cast<CallBase>(U->getUser()); in captured() local
539 if (!CB) { in captured()
544 Function *F = CB->getCalledFunction(); in captured()
550 assert(!CB->isCallee(U) && "callee operand reported captured?"); in captured()
551 const unsigned UseIndex = CB->getDataOperandNo(U); in captured()
552 if (UseIndex >= CB->arg_size()) { in captured()
554 assert(CB->hasOperandBundles() && "Must be!"); in captured()
650 CallBase &CB = cast<CallBase>(*I); in determinePointerAccessAttrs() local
651 if (CB.isCallee(U)) { in determinePointerAccessAttrs()
660 const unsigned UseIndex = CB.getDataOperandNo(U); in determinePointerAccessAttrs()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/IR/
H A DAbstractCallSite.cpp35 const CallBase &CB, SmallVectorImpl<const Use *> &CallbackUses) { in getCallbackUses() argument
36 const Function *Callee = CB.getCalledFunction(); in getCallbackUses()
49 if (CBCalleeIdx < CB.arg_size()) in getCallbackUses()
50 CallbackUses.push_back(CB.arg_begin() + CBCalleeIdx); in getCallbackUses()
56 : CB(dyn_cast<CallBase>(U->getUser())) { in AbstractCallSite()
59 if (!CB) { in AbstractCallSite()
68 CB = dyn_cast<CallBase>(U->getUser()); in AbstractCallSite()
71 if (!CB) { in AbstractCallSite()
79 if (CB->isCallee(U)) { in AbstractCallSite()
86 Function *Callee = CB->getCalledFunction(); in AbstractCallSite()
[all …]
H A DConvergenceVerifier.cpp20 const auto *CB = dyn_cast<CallBase>(&I); in getConvOp() local
21 if (!CB) in getConvOp()
23 switch (CB->getIntrinsicID()) { in getConvOp()
45 auto *CB = dyn_cast<CallBase>(&I); in findAndCheckConvergenceTokenUsed() local
46 if (!CB) in findAndCheckConvergenceTokenUsed()
50 CB->countOperandBundlesOfType(LLVMContext::OB_convergencectrl); in findAndCheckConvergenceTokenUsed()
53 {Context.print(CB)}); in findAndCheckConvergenceTokenUsed()
57 auto Bundle = CB->getOperandBundle(LLVMContext::OB_convergencectrl); in findAndCheckConvergenceTokenUsed()
61 {Context.print(CB)}); in findAndCheckConvergenceTokenUsed()
86 if (auto *CB = dyn_cast<CallBase>(&I)) { in isConvergent() local
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/
H A DIndirectCallPromotion.cpp345 const CallBase &CB, ArrayRef<InstrProfValueData> ValueDataRef,
351 bool tryToPromoteWithFuncCmp(CallBase &CB, Instruction *VPtr,
362 CallBase &CB, Instruction *VPtr, ArrayRef<PromotionCandidate> Candidates,
368 bool isProfitableToCompareVTables(const CallBase &CB,
379 Instruction *computeVTableInfos(const CallBase *CB,
386 void updateFuncValueProfiles(CallBase &CB, ArrayRef<InstrProfValueData> VDs,
414 const CallBase &CB, ArrayRef<InstrProfValueData> ValueDataRef, in getPromotionCandidatesForCallSite() argument
418 LLVM_DEBUG(dbgs() << " \nWork on callsite #" << NumOfPGOICallsites << CB in getPromotionCandidatesForCallSite()
435 if (ICPInvokeOnly && isa<CallInst>(CB)) { in getPromotionCandidatesForCallSite()
438 return OptimizationRemarkMissed(DEBUG_TYPE, "UserOptions", &CB) in getPromotionCandidatesForCallSite()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/
H A DR600MCCodeEmitter.cpp42 void encodeInstruction(const MCInst &MI, SmallVectorImpl<char> &CB,
52 void emit(uint32_t value, SmallVectorImpl<char> &CB) const;
53 void emit(uint64_t value, SmallVectorImpl<char> &CB) const;
87 SmallVectorImpl<char> &CB, in encodeInstruction() argument
105 emit(InstWord01, CB); in encodeInstruction()
106 emit(InstWord2, CB); in encodeInstruction()
107 emit((uint32_t)0, CB); in encodeInstruction()
124 emit(Word01, CB); in encodeInstruction()
125 emit(Word2, CB); in encodeInstruction()
126 emit((uint32_t)0, CB); in encodeInstruction()
[all …]
/freebsd/contrib/llvm-project/llvm/include/llvm/Analysis/
H A DObjCARCUtil.h29 inline bool hasAttachedCallOpBundle(const CallBase *CB) { in hasAttachedCallOpBundle() argument
36 return !CB->getFunctionType()->getReturnType()->isVoidTy() && in hasAttachedCallOpBundle()
37 CB->getOperandBundle(LLVMContext::OB_clang_arc_attachedcall) in hasAttachedCallOpBundle()
43 inline std::optional<Function *> getAttachedARCFunction(const CallBase *CB) { in getAttachedARCFunction() argument
44 auto B = CB->getOperandBundle(LLVMContext::OB_clang_arc_attachedcall); in getAttachedARCFunction()
60 inline ARCInstKind getAttachedARCFunctionKind(const CallBase *CB) { in getAttachedARCFunctionKind() argument
61 std::optional<Function *> Fn = getAttachedARCFunction(CB); in getAttachedARCFunctionKind()
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Coroutines/
H A DCoroEarly.cpp28 void lowerResumeOrDestroy(CallBase &CB, CoroSubFnInst::ResumeKind);
47 void Lowerer::lowerResumeOrDestroy(CallBase &CB, in lowerResumeOrDestroy() argument
49 Value *ResumeAddr = makeSubFnCall(CB.getArgOperand(0), Index, &CB); in lowerResumeOrDestroy()
50 CB.setCalledOperand(ResumeAddr); in lowerResumeOrDestroy()
51 CB.setCallingConv(CallingConv::Fast); in lowerResumeOrDestroy()
166 if (auto *CB = dyn_cast<CoroBeginInst>(U)) in setCannotDuplicate() local
167 CB->setCannotDuplicate(); in setCannotDuplicate()
175 auto *CB = dyn_cast<CallBase>(&I); in lowerEarlyIntrinsics() local
176 if (!CB) in lowerEarlyIntrinsics()
179 switch (CB->getIntrinsicID()) { in lowerEarlyIntrinsics()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Target/WebAssembly/
H A DWebAssemblyOptimizeReturned.cpp45 void visitCallBase(CallBase &CB);
58 void OptimizeReturned::visitCallBase(CallBase &CB) { in visitCallBase() argument
59 for (unsigned I = 0, E = CB.arg_size(); I < E; ++I) in visitCallBase()
60 if (CB.paramHasAttr(I, Attribute::Returned)) { in visitCallBase()
61 Value *Arg = CB.getArgOperand(I); in visitCallBase()
66 Arg->replaceUsesWithIf(&CB, in visitCallBase()
67 [&](Use &U) { return DT->dominates(&CB, U); }); in visitCallBase()
/freebsd/contrib/llvm-project/llvm/include/llvm/Transforms/Utils/
H A DCallPromotionUtils.h34 bool isLegalToPromote(const CallBase &CB, Function *Callee,
44 CallBase &promoteCall(CallBase &CB, Function *Callee,
56 CallBase &promoteCallWithIfThenElse(CallBase &CB, Function *Callee,
70 CallBase &promoteCallWithVTableCmp(CallBase &CB, Instruction *VPtr,
96 bool tryPromoteCall(CallBase &CB);
105 CallBase &versionCallSite(CallBase &CB, Value *Callee, MDNode *BranchWeights);

12345678910>>...16