Lines Matching defs:BC
124 uint64_t Inliner::getSizeOfCallInst(const BinaryContext &BC) {
129 BC.MIB->createCall(Inst, BC.Ctx->createNamedTempSymbol(), BC.Ctx.get());
130 SizeOfCallInst = BC.computeInstructionSize(Inst);
135 uint64_t Inliner::getSizeOfTailCallInst(const BinaryContext &BC) {
140 BC.MIB->createTailCall(Inst, BC.Ctx->createNamedTempSymbol(), BC.Ctx.get());
141 SizeOfTailCallInst = BC.computeInstructionSize(Inst);
147 const BinaryContext &BC = BF.getBinaryContext();
166 const MCPhysReg SPReg = BC.MIB->getStackPointer();
171 if (BC.MIB->isTailCall(Inst))
174 if (BC.MIB->isCFI(Inst)) {
179 if (BC.MIB->isCall(Inst))
183 if (BC.MIB->isPush(Inst) || BC.MIB->isPop(Inst))
186 DirectSP |= BC.MIB->hasDefOfPhysReg(Inst, SPReg) ||
187 BC.MIB->hasUseOfPhysReg(Inst, SPReg);
212 if (LastInst && BC.MIB->isReturn(*LastInst) &&
213 !BC.MIB->isTailCall(*LastInst)) {
214 const uint64_t RetInstSize = BC.computeInstructionSize(*LastInst);
223 void Inliner::findInliningCandidates(BinaryContext &BC) {
224 for (const auto &BFI : BC.getBinaryFunctions()) {
239 BinaryContext &BC = CallerFunction.getBinaryContext();
240 auto &MIB = *BC.MIB;
249 const bool CSIsInvoke = BC.MIB->isInvoke(*CallInst);
250 const bool CSIsTailCall = BC.MIB->isTailCall(*CallInst);
251 const int64_t CSGNUArgsSize = BC.MIB->getGnuArgsSize(*CallInst);
253 BC.MIB->getEHInfo(*CallInst);
313 MIB.stripAnnotations(Inst, /*KeepTC=*/BC.isX86() || BC.isAArch64());
326 BC.Ctx.get());
399 BinaryContext &BC = Function.getBinaryContext();
411 if (!BC.MIB->isCall(Inst) || MCPlus::getNumPrimeOperands(Inst) != 1 ||
417 const MCSymbol *TargetSymbol = BC.MIB->getTargetSymbol(Inst);
423 BC.getFunctionForSymbol(TargetSymbol, &EntryID);
441 const bool IsTailCall = BC.MIB->isTailCall(Inst);
450 IInfo->second.SizeAfterTailCallInlining - getSizeOfTailCallInst(BC);
453 IInfo->second.SizeAfterInlining - getSizeOfCallInst(BC);
500 Error Inliner::runOnFunctions(BinaryContext &BC) {
515 findInliningCandidates(BC);
518 for (auto &BFI : BC.getBinaryFunctions()) {
544 BC.outs() << "BOLT-INFO: inlined " << NumInlinedDynamicCalls << " calls at "