Lines Matching refs:BC
125 uint64_t Inliner::getSizeOfCallInst(const BinaryContext &BC) { in getSizeOfCallInst() argument
130 BC.MIB->createCall(Inst, BC.Ctx->createNamedTempSymbol(), BC.Ctx.get()); in getSizeOfCallInst()
131 SizeOfCallInst = BC.computeInstructionSize(Inst); in getSizeOfCallInst()
136 uint64_t Inliner::getSizeOfTailCallInst(const BinaryContext &BC) { in getSizeOfTailCallInst() argument
141 BC.MIB->createTailCall(Inst, BC.Ctx->createNamedTempSymbol(), BC.Ctx.get()); in getSizeOfTailCallInst()
142 SizeOfTailCallInst = BC.computeInstructionSize(Inst); in getSizeOfTailCallInst()
148 const BinaryContext &BC = BF.getBinaryContext(); in getInliningInfo() local
167 const MCPhysReg SPReg = BC.MIB->getStackPointer(); in getInliningInfo()
172 if (BC.MIB->isTailCall(Inst)) in getInliningInfo()
175 if (BC.MIB->isCFI(Inst)) { in getInliningInfo()
180 if (BC.MIB->isCall(Inst)) in getInliningInfo()
184 if (BC.MIB->isPush(Inst) || BC.MIB->isPop(Inst)) in getInliningInfo()
187 DirectSP |= BC.MIB->hasDefOfPhysReg(Inst, SPReg) || in getInliningInfo()
188 BC.MIB->hasUseOfPhysReg(Inst, SPReg); in getInliningInfo()
213 if (LastInst && BC.MIB->isReturn(*LastInst) && in getInliningInfo()
214 !BC.MIB->isTailCall(*LastInst)) { in getInliningInfo()
215 const uint64_t RetInstSize = BC.computeInstructionSize(*LastInst); in getInliningInfo()
224 void Inliner::findInliningCandidates(BinaryContext &BC) { in findInliningCandidates() argument
225 for (const auto &BFI : BC.getBinaryFunctions()) { in findInliningCandidates()
240 BinaryContext &BC = CallerFunction.getBinaryContext(); in inlineCall() local
241 auto &MIB = *BC.MIB; in inlineCall()
250 const bool CSIsInvoke = BC.MIB->isInvoke(*CallInst); in inlineCall()
251 const bool CSIsTailCall = BC.MIB->isTailCall(*CallInst); in inlineCall()
252 const int64_t CSGNUArgsSize = BC.MIB->getGnuArgsSize(*CallInst); in inlineCall()
253 const Optional<MCPlus::MCLandingPad> CSEHInfo = BC.MIB->getEHInfo(*CallInst); in inlineCall()
313 MIB.stripAnnotations(Inst, /*KeepTC=*/BC.isX86()); in inlineCall()
326 BC.Ctx.get()); in inlineCall()
397 BinaryContext &BC = Function.getBinaryContext(); in inlineCallsInFunction() local
409 if (!BC.MIB->isCall(Inst) || MCPlus::getNumPrimeOperands(Inst) != 1 || in inlineCallsInFunction()
415 const MCSymbol *TargetSymbol = BC.MIB->getTargetSymbol(Inst); in inlineCallsInFunction()
421 BC.getFunctionForSymbol(TargetSymbol, &EntryID); in inlineCallsInFunction()
439 const bool IsTailCall = BC.MIB->isTailCall(Inst); in inlineCallsInFunction()
448 IInfo->second.SizeAfterTailCallInlining - getSizeOfTailCallInst(BC); in inlineCallsInFunction()
451 IInfo->second.SizeAfterInlining - getSizeOfCallInst(BC); in inlineCallsInFunction()
498 void Inliner::runOnFunctions(BinaryContext &BC) { in runOnFunctions() argument
513 findInliningCandidates(BC); in runOnFunctions()
516 for (auto &BFI : BC.getBinaryFunctions()) { in runOnFunctions()