1 //===- InlineAdvisor.cpp - analysis pass implementation -------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file implements InlineAdvisorAnalysis and DefaultInlineAdvisor, and 10 // related types. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #include "llvm/Analysis/InlineAdvisor.h" 15 #include "llvm/ADT/Statistic.h" 16 #include "llvm/Analysis/InlineCost.h" 17 #include "llvm/Analysis/OptimizationRemarkEmitter.h" 18 #include "llvm/Analysis/ProfileSummaryInfo.h" 19 #include "llvm/Analysis/TargetLibraryInfo.h" 20 #include "llvm/Analysis/TargetTransformInfo.h" 21 #include "llvm/IR/DebugInfoMetadata.h" 22 #include "llvm/IR/Instructions.h" 23 #include "llvm/Support/CommandLine.h" 24 #include "llvm/Support/raw_ostream.h" 25 26 using namespace llvm; 27 #define DEBUG_TYPE "inline" 28 29 // This weirdly named statistic tracks the number of times that, when attempting 30 // to inline a function A into B, we analyze the callers of B in order to see 31 // if those would be more profitable and blocked inline steps. 32 STATISTIC(NumCallerCallersAnalyzed, "Number of caller-callers analyzed"); 33 34 /// Flag to add inline messages as callsite attributes 'inline-remark'. 35 static cl::opt<bool> 36 InlineRemarkAttribute("inline-remark-attribute", cl::init(false), 37 cl::Hidden, 38 cl::desc("Enable adding inline-remark attribute to" 39 " callsites processed by inliner but decided" 40 " to be not inlined")); 41 42 // An integer used to limit the cost of inline deferral. The default negative 43 // number tells shouldBeDeferred to only take the secondary cost into account. 44 static cl::opt<int> 45 InlineDeferralScale("inline-deferral-scale", 46 cl::desc("Scale to limit the cost of inline deferral"), 47 cl::init(2), cl::Hidden); 48 49 extern cl::opt<InlinerFunctionImportStatsOpts> InlinerFunctionImportStats; 50 51 namespace { 52 using namespace llvm::ore; 53 class MandatoryInlineAdvice : public InlineAdvice { 54 public: 55 MandatoryInlineAdvice(InlineAdvisor *Advisor, CallBase &CB, 56 OptimizationRemarkEmitter &ORE, 57 bool IsInliningMandatory) 58 : InlineAdvice(Advisor, CB, ORE, IsInliningMandatory) {} 59 60 private: 61 void recordInliningWithCalleeDeletedImpl() override { recordInliningImpl(); } 62 63 void recordInliningImpl() override { 64 if (IsInliningRecommended) 65 emitInlinedInto(ORE, DLoc, Block, *Callee, *Caller, IsInliningRecommended, 66 [&](OptimizationRemark &Remark) { 67 Remark << ": always inline attribute"; 68 }); 69 } 70 71 void recordUnsuccessfulInliningImpl(const InlineResult &Result) override { 72 if (IsInliningRecommended) 73 ORE.emit([&]() { 74 return OptimizationRemarkMissed(DEBUG_TYPE, "NotInlined", DLoc, Block) 75 << "'" << NV("Callee", Callee) << "' is not AlwaysInline into '" 76 << NV("Caller", Caller) 77 << "': " << NV("Reason", Result.getFailureReason()); 78 }); 79 } 80 81 void recordUnattemptedInliningImpl() override { 82 assert(!IsInliningRecommended && "Expected to attempt inlining"); 83 } 84 }; 85 } // namespace 86 87 void DefaultInlineAdvice::recordUnsuccessfulInliningImpl( 88 const InlineResult &Result) { 89 using namespace ore; 90 llvm::setInlineRemark(*OriginalCB, std::string(Result.getFailureReason()) + 91 "; " + inlineCostStr(*OIC)); 92 ORE.emit([&]() { 93 return OptimizationRemarkMissed(DEBUG_TYPE, "NotInlined", DLoc, Block) 94 << "'" << NV("Callee", Callee) << "' is not inlined into '" 95 << NV("Caller", Caller) 96 << "': " << NV("Reason", Result.getFailureReason()); 97 }); 98 } 99 100 void DefaultInlineAdvice::recordInliningWithCalleeDeletedImpl() { 101 if (EmitRemarks) 102 emitInlinedIntoBasedOnCost(ORE, DLoc, Block, *Callee, *Caller, *OIC); 103 } 104 105 void DefaultInlineAdvice::recordInliningImpl() { 106 if (EmitRemarks) 107 emitInlinedIntoBasedOnCost(ORE, DLoc, Block, *Callee, *Caller, *OIC); 108 } 109 110 llvm::Optional<llvm::InlineCost> static getDefaultInlineAdvice( 111 CallBase &CB, FunctionAnalysisManager &FAM, const InlineParams &Params) { 112 Function &Caller = *CB.getCaller(); 113 ProfileSummaryInfo *PSI = 114 FAM.getResult<ModuleAnalysisManagerFunctionProxy>(Caller) 115 .getCachedResult<ProfileSummaryAnalysis>( 116 *CB.getParent()->getParent()->getParent()); 117 118 auto &ORE = FAM.getResult<OptimizationRemarkEmitterAnalysis>(Caller); 119 auto GetAssumptionCache = [&](Function &F) -> AssumptionCache & { 120 return FAM.getResult<AssumptionAnalysis>(F); 121 }; 122 auto GetBFI = [&](Function &F) -> BlockFrequencyInfo & { 123 return FAM.getResult<BlockFrequencyAnalysis>(F); 124 }; 125 auto GetTLI = [&](Function &F) -> const TargetLibraryInfo & { 126 return FAM.getResult<TargetLibraryAnalysis>(F); 127 }; 128 129 auto GetInlineCost = [&](CallBase &CB) { 130 Function &Callee = *CB.getCalledFunction(); 131 auto &CalleeTTI = FAM.getResult<TargetIRAnalysis>(Callee); 132 bool RemarksEnabled = 133 Callee.getContext().getDiagHandlerPtr()->isMissedOptRemarkEnabled( 134 DEBUG_TYPE); 135 return getInlineCost(CB, Params, CalleeTTI, GetAssumptionCache, GetTLI, 136 GetBFI, PSI, RemarksEnabled ? &ORE : nullptr); 137 }; 138 return llvm::shouldInline(CB, GetInlineCost, ORE, 139 Params.EnableDeferral.getValueOr(false)); 140 } 141 142 std::unique_ptr<InlineAdvice> 143 DefaultInlineAdvisor::getAdviceImpl(CallBase &CB) { 144 auto OIC = getDefaultInlineAdvice(CB, FAM, Params); 145 return std::make_unique<DefaultInlineAdvice>( 146 this, CB, OIC, 147 FAM.getResult<OptimizationRemarkEmitterAnalysis>(*CB.getCaller())); 148 } 149 150 InlineAdvice::InlineAdvice(InlineAdvisor *Advisor, CallBase &CB, 151 OptimizationRemarkEmitter &ORE, 152 bool IsInliningRecommended) 153 : Advisor(Advisor), Caller(CB.getCaller()), Callee(CB.getCalledFunction()), 154 DLoc(CB.getDebugLoc()), Block(CB.getParent()), ORE(ORE), 155 IsInliningRecommended(IsInliningRecommended) {} 156 157 void InlineAdvisor::markFunctionAsDeleted(Function *F) { 158 assert((!DeletedFunctions.count(F)) && 159 "Cannot put cause a function to become dead twice!"); 160 DeletedFunctions.insert(F); 161 } 162 163 void InlineAdvisor::freeDeletedFunctions() { 164 for (auto *F : DeletedFunctions) 165 delete F; 166 DeletedFunctions.clear(); 167 } 168 169 void InlineAdvice::recordInlineStatsIfNeeded() { 170 if (Advisor->ImportedFunctionsStats) 171 Advisor->ImportedFunctionsStats->recordInline(*Caller, *Callee); 172 } 173 174 void InlineAdvice::recordInlining() { 175 markRecorded(); 176 recordInlineStatsIfNeeded(); 177 recordInliningImpl(); 178 } 179 180 void InlineAdvice::recordInliningWithCalleeDeleted() { 181 markRecorded(); 182 recordInlineStatsIfNeeded(); 183 Advisor->markFunctionAsDeleted(Callee); 184 recordInliningWithCalleeDeletedImpl(); 185 } 186 187 AnalysisKey InlineAdvisorAnalysis::Key; 188 189 bool InlineAdvisorAnalysis::Result::tryCreate(InlineParams Params, 190 InliningAdvisorMode Mode, 191 StringRef ReplayFile, 192 ReplayInlineScope ReplayScope) { 193 auto &FAM = MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager(); 194 switch (Mode) { 195 case InliningAdvisorMode::Default: 196 LLVM_DEBUG(dbgs() << "Using default inliner heuristic.\n"); 197 Advisor.reset(new DefaultInlineAdvisor(M, FAM, Params)); 198 // Restrict replay to default advisor, ML advisors are stateful so 199 // replay will need augmentations to interleave with them correctly. 200 if (!ReplayFile.empty()) { 201 Advisor = llvm::getReplayInlineAdvisor( 202 M, FAM, M.getContext(), std::move(Advisor), ReplayFile, ReplayScope, 203 /* EmitRemarks =*/true); 204 } 205 break; 206 case InliningAdvisorMode::Development: 207 #ifdef LLVM_HAVE_TF_API 208 LLVM_DEBUG(dbgs() << "Using development-mode inliner policy.\n"); 209 Advisor = 210 llvm::getDevelopmentModeAdvisor(M, MAM, [&FAM, Params](CallBase &CB) { 211 auto OIC = getDefaultInlineAdvice(CB, FAM, Params); 212 return OIC.hasValue(); 213 }); 214 #endif 215 break; 216 case InliningAdvisorMode::Release: 217 #ifdef LLVM_HAVE_TF_AOT 218 LLVM_DEBUG(dbgs() << "Using release-mode inliner policy.\n"); 219 Advisor = llvm::getReleaseModeAdvisor(M, MAM); 220 #endif 221 break; 222 } 223 224 return !!Advisor; 225 } 226 227 /// Return true if inlining of CB can block the caller from being 228 /// inlined which is proved to be more beneficial. \p IC is the 229 /// estimated inline cost associated with callsite \p CB. 230 /// \p TotalSecondaryCost will be set to the estimated cost of inlining the 231 /// caller if \p CB is suppressed for inlining. 232 static bool 233 shouldBeDeferred(Function *Caller, InlineCost IC, int &TotalSecondaryCost, 234 function_ref<InlineCost(CallBase &CB)> GetInlineCost) { 235 // For now we only handle local or inline functions. 236 if (!Caller->hasLocalLinkage() && !Caller->hasLinkOnceODRLinkage()) 237 return false; 238 // If the cost of inlining CB is non-positive, it is not going to prevent the 239 // caller from being inlined into its callers and hence we don't need to 240 // defer. 241 if (IC.getCost() <= 0) 242 return false; 243 // Try to detect the case where the current inlining candidate caller (call 244 // it B) is a static or linkonce-ODR function and is an inlining candidate 245 // elsewhere, and the current candidate callee (call it C) is large enough 246 // that inlining it into B would make B too big to inline later. In these 247 // circumstances it may be best not to inline C into B, but to inline B into 248 // its callers. 249 // 250 // This only applies to static and linkonce-ODR functions because those are 251 // expected to be available for inlining in the translation units where they 252 // are used. Thus we will always have the opportunity to make local inlining 253 // decisions. Importantly the linkonce-ODR linkage covers inline functions 254 // and templates in C++. 255 // 256 // FIXME: All of this logic should be sunk into getInlineCost. It relies on 257 // the internal implementation of the inline cost metrics rather than 258 // treating them as truly abstract units etc. 259 TotalSecondaryCost = 0; 260 // The candidate cost to be imposed upon the current function. 261 int CandidateCost = IC.getCost() - 1; 262 // If the caller has local linkage and can be inlined to all its callers, we 263 // can apply a huge negative bonus to TotalSecondaryCost. 264 bool ApplyLastCallBonus = Caller->hasLocalLinkage() && !Caller->hasOneUse(); 265 // This bool tracks what happens if we DO inline C into B. 266 bool InliningPreventsSomeOuterInline = false; 267 unsigned NumCallerUsers = 0; 268 for (User *U : Caller->users()) { 269 CallBase *CS2 = dyn_cast<CallBase>(U); 270 271 // If this isn't a call to Caller (it could be some other sort 272 // of reference) skip it. Such references will prevent the caller 273 // from being removed. 274 if (!CS2 || CS2->getCalledFunction() != Caller) { 275 ApplyLastCallBonus = false; 276 continue; 277 } 278 279 InlineCost IC2 = GetInlineCost(*CS2); 280 ++NumCallerCallersAnalyzed; 281 if (!IC2) { 282 ApplyLastCallBonus = false; 283 continue; 284 } 285 if (IC2.isAlways()) 286 continue; 287 288 // See if inlining of the original callsite would erase the cost delta of 289 // this callsite. We subtract off the penalty for the call instruction, 290 // which we would be deleting. 291 if (IC2.getCostDelta() <= CandidateCost) { 292 InliningPreventsSomeOuterInline = true; 293 TotalSecondaryCost += IC2.getCost(); 294 NumCallerUsers++; 295 } 296 } 297 298 if (!InliningPreventsSomeOuterInline) 299 return false; 300 301 // If all outer calls to Caller would get inlined, the cost for the last 302 // one is set very low by getInlineCost, in anticipation that Caller will 303 // be removed entirely. We did not account for this above unless there 304 // is only one caller of Caller. 305 if (ApplyLastCallBonus) 306 TotalSecondaryCost -= InlineConstants::LastCallToStaticBonus; 307 308 // If InlineDeferralScale is negative, then ignore the cost of primary 309 // inlining -- IC.getCost() multiplied by the number of callers to Caller. 310 if (InlineDeferralScale < 0) 311 return TotalSecondaryCost < IC.getCost(); 312 313 int TotalCost = TotalSecondaryCost + IC.getCost() * NumCallerUsers; 314 int Allowance = IC.getCost() * InlineDeferralScale; 315 return TotalCost < Allowance; 316 } 317 318 namespace llvm { 319 static raw_ostream &operator<<(raw_ostream &R, const ore::NV &Arg) { 320 return R << Arg.Val; 321 } 322 323 template <class RemarkT> 324 RemarkT &operator<<(RemarkT &&R, const InlineCost &IC) { 325 using namespace ore; 326 if (IC.isAlways()) { 327 R << "(cost=always)"; 328 } else if (IC.isNever()) { 329 R << "(cost=never)"; 330 } else { 331 R << "(cost=" << ore::NV("Cost", IC.getCost()) 332 << ", threshold=" << ore::NV("Threshold", IC.getThreshold()) << ")"; 333 } 334 if (const char *Reason = IC.getReason()) 335 R << ": " << ore::NV("Reason", Reason); 336 return R; 337 } 338 } // namespace llvm 339 340 std::string llvm::inlineCostStr(const InlineCost &IC) { 341 std::string Buffer; 342 raw_string_ostream Remark(Buffer); 343 Remark << IC; 344 return Remark.str(); 345 } 346 347 void llvm::setInlineRemark(CallBase &CB, StringRef Message) { 348 if (!InlineRemarkAttribute) 349 return; 350 351 Attribute Attr = Attribute::get(CB.getContext(), "inline-remark", Message); 352 CB.addFnAttr(Attr); 353 } 354 355 /// Return the cost only if the inliner should attempt to inline at the given 356 /// CallSite. If we return the cost, we will emit an optimisation remark later 357 /// using that cost, so we won't do so from this function. Return None if 358 /// inlining should not be attempted. 359 Optional<InlineCost> 360 llvm::shouldInline(CallBase &CB, 361 function_ref<InlineCost(CallBase &CB)> GetInlineCost, 362 OptimizationRemarkEmitter &ORE, bool EnableDeferral) { 363 using namespace ore; 364 365 InlineCost IC = GetInlineCost(CB); 366 Instruction *Call = &CB; 367 Function *Callee = CB.getCalledFunction(); 368 Function *Caller = CB.getCaller(); 369 370 if (IC.isAlways()) { 371 LLVM_DEBUG(dbgs() << " Inlining " << inlineCostStr(IC) 372 << ", Call: " << CB << "\n"); 373 return IC; 374 } 375 376 if (!IC) { 377 LLVM_DEBUG(dbgs() << " NOT Inlining " << inlineCostStr(IC) 378 << ", Call: " << CB << "\n"); 379 if (IC.isNever()) { 380 ORE.emit([&]() { 381 return OptimizationRemarkMissed(DEBUG_TYPE, "NeverInline", Call) 382 << "'" << NV("Callee", Callee) << "' not inlined into '" 383 << NV("Caller", Caller) 384 << "' because it should never be inlined " << IC; 385 }); 386 } else { 387 ORE.emit([&]() { 388 return OptimizationRemarkMissed(DEBUG_TYPE, "TooCostly", Call) 389 << "'" << NV("Callee", Callee) << "' not inlined into '" 390 << NV("Caller", Caller) << "' because too costly to inline " 391 << IC; 392 }); 393 } 394 setInlineRemark(CB, inlineCostStr(IC)); 395 return None; 396 } 397 398 int TotalSecondaryCost = 0; 399 if (EnableDeferral && 400 shouldBeDeferred(Caller, IC, TotalSecondaryCost, GetInlineCost)) { 401 LLVM_DEBUG(dbgs() << " NOT Inlining: " << CB 402 << " Cost = " << IC.getCost() 403 << ", outer Cost = " << TotalSecondaryCost << '\n'); 404 ORE.emit([&]() { 405 return OptimizationRemarkMissed(DEBUG_TYPE, "IncreaseCostInOtherContexts", 406 Call) 407 << "Not inlining. Cost of inlining '" << NV("Callee", Callee) 408 << "' increases the cost of inlining '" << NV("Caller", Caller) 409 << "' in other contexts"; 410 }); 411 setInlineRemark(CB, "deferred"); 412 // IC does not bool() to false, so get an InlineCost that will. 413 // This will not be inspected to make an error message. 414 return None; 415 } 416 417 LLVM_DEBUG(dbgs() << " Inlining " << inlineCostStr(IC) << ", Call: " << CB 418 << '\n'); 419 return IC; 420 } 421 422 std::string llvm::getCallSiteLocation(DebugLoc DLoc) { 423 std::string Buffer; 424 raw_string_ostream CallSiteLoc(Buffer); 425 bool First = true; 426 for (DILocation *DIL = DLoc.get(); DIL; DIL = DIL->getInlinedAt()) { 427 if (!First) 428 CallSiteLoc << " @ "; 429 // Note that negative line offset is actually possible, but we use 430 // unsigned int to match line offset representation in remarks so 431 // it's directly consumable by relay advisor. 432 uint32_t Offset = 433 DIL->getLine() - DIL->getScope()->getSubprogram()->getLine(); 434 uint32_t Discriminator = DIL->getBaseDiscriminator(); 435 StringRef Name = DIL->getScope()->getSubprogram()->getLinkageName(); 436 if (Name.empty()) 437 Name = DIL->getScope()->getSubprogram()->getName(); 438 CallSiteLoc << Name.str() << ":" << llvm::utostr(Offset) << ":" 439 << llvm::utostr(DIL->getColumn()); 440 if (Discriminator) 441 CallSiteLoc << "." << llvm::utostr(Discriminator); 442 First = false; 443 } 444 445 return CallSiteLoc.str(); 446 } 447 448 void llvm::addLocationToRemarks(OptimizationRemark &Remark, DebugLoc DLoc) { 449 if (!DLoc.get()) { 450 return; 451 } 452 453 bool First = true; 454 Remark << " at callsite "; 455 for (DILocation *DIL = DLoc.get(); DIL; DIL = DIL->getInlinedAt()) { 456 if (!First) 457 Remark << " @ "; 458 unsigned int Offset = DIL->getLine(); 459 Offset -= DIL->getScope()->getSubprogram()->getLine(); 460 unsigned int Discriminator = DIL->getBaseDiscriminator(); 461 StringRef Name = DIL->getScope()->getSubprogram()->getLinkageName(); 462 if (Name.empty()) 463 Name = DIL->getScope()->getSubprogram()->getName(); 464 Remark << Name << ":" << ore::NV("Line", Offset) << ":" 465 << ore::NV("Column", DIL->getColumn()); 466 if (Discriminator) 467 Remark << "." << ore::NV("Disc", Discriminator); 468 First = false; 469 } 470 471 Remark << ";"; 472 } 473 474 void llvm::emitInlinedInto( 475 OptimizationRemarkEmitter &ORE, DebugLoc DLoc, const BasicBlock *Block, 476 const Function &Callee, const Function &Caller, bool AlwaysInline, 477 function_ref<void(OptimizationRemark &)> ExtraContext, 478 const char *PassName) { 479 ORE.emit([&]() { 480 StringRef RemarkName = AlwaysInline ? "AlwaysInline" : "Inlined"; 481 OptimizationRemark Remark(PassName ? PassName : DEBUG_TYPE, RemarkName, 482 DLoc, Block); 483 Remark << "'" << ore::NV("Callee", &Callee) << "' inlined into '" 484 << ore::NV("Caller", &Caller) << "'"; 485 if (ExtraContext) 486 ExtraContext(Remark); 487 addLocationToRemarks(Remark, DLoc); 488 return Remark; 489 }); 490 } 491 492 void llvm::emitInlinedIntoBasedOnCost( 493 OptimizationRemarkEmitter &ORE, DebugLoc DLoc, const BasicBlock *Block, 494 const Function &Callee, const Function &Caller, const InlineCost &IC, 495 bool ForProfileContext, const char *PassName) { 496 llvm::emitInlinedInto( 497 ORE, DLoc, Block, Callee, Caller, IC.isAlways(), 498 [&](OptimizationRemark &Remark) { 499 if (ForProfileContext) 500 Remark << " to match profiling context"; 501 Remark << " with " << IC; 502 }, 503 PassName); 504 } 505 506 InlineAdvisor::InlineAdvisor(Module &M, FunctionAnalysisManager &FAM) 507 : M(M), FAM(FAM) { 508 if (InlinerFunctionImportStats != InlinerFunctionImportStatsOpts::No) { 509 ImportedFunctionsStats = 510 std::make_unique<ImportedFunctionsInliningStatistics>(); 511 ImportedFunctionsStats->setModuleInfo(M); 512 } 513 } 514 515 InlineAdvisor::~InlineAdvisor() { 516 if (ImportedFunctionsStats) { 517 assert(InlinerFunctionImportStats != InlinerFunctionImportStatsOpts::No); 518 ImportedFunctionsStats->dump(InlinerFunctionImportStats == 519 InlinerFunctionImportStatsOpts::Verbose); 520 } 521 522 freeDeletedFunctions(); 523 } 524 525 std::unique_ptr<InlineAdvice> InlineAdvisor::getMandatoryAdvice(CallBase &CB, 526 bool Advice) { 527 return std::make_unique<MandatoryInlineAdvice>(this, CB, getCallerORE(CB), 528 Advice); 529 } 530 531 InlineAdvisor::MandatoryInliningKind 532 InlineAdvisor::getMandatoryKind(CallBase &CB, FunctionAnalysisManager &FAM, 533 OptimizationRemarkEmitter &ORE) { 534 auto &Callee = *CB.getCalledFunction(); 535 536 auto GetTLI = [&](Function &F) -> const TargetLibraryInfo & { 537 return FAM.getResult<TargetLibraryAnalysis>(F); 538 }; 539 540 auto &TIR = FAM.getResult<TargetIRAnalysis>(Callee); 541 542 auto TrivialDecision = 543 llvm::getAttributeBasedInliningDecision(CB, &Callee, TIR, GetTLI); 544 545 if (TrivialDecision.hasValue()) { 546 if (TrivialDecision->isSuccess()) 547 return MandatoryInliningKind::Always; 548 else 549 return MandatoryInliningKind::Never; 550 } 551 return MandatoryInliningKind::NotMandatory; 552 } 553 554 std::unique_ptr<InlineAdvice> InlineAdvisor::getAdvice(CallBase &CB, 555 bool MandatoryOnly) { 556 if (!MandatoryOnly) 557 return getAdviceImpl(CB); 558 bool Advice = CB.getCaller() != CB.getCalledFunction() && 559 MandatoryInliningKind::Always == 560 getMandatoryKind(CB, FAM, getCallerORE(CB)); 561 return getMandatoryAdvice(CB, Advice); 562 } 563 564 OptimizationRemarkEmitter &InlineAdvisor::getCallerORE(CallBase &CB) { 565 return FAM.getResult<OptimizationRemarkEmitterAnalysis>(*CB.getCaller()); 566 } 567