Skip to content

Commit 9bffb10

Browse files
authored
Revert "[BOLT][BTI] Skip inlining BasicBlocks containing indirect tailcalls" (#169881)
Reverts #168403 The attached lit test is failing in some build configurations.
1 parent 26b82e5 commit 9bffb10

File tree

2 files changed

+0
-65
lines changed

2 files changed

+0
-65
lines changed

bolt/lib/Passes/Inliner.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -491,32 +491,6 @@ bool Inliner::inlineCallsInFunction(BinaryFunction &Function) {
491491
}
492492
}
493493

494-
// AArch64 BTI:
495-
// If the callee has an indirect tailcall (BR), we would transform it to
496-
// an indirect call (BLR) in InlineCall. Because of this, we would have to
497-
// update the BTI at the target of the tailcall. However, these targets
498-
// are not known. Instead, we skip inlining blocks with indirect
499-
// tailcalls.
500-
auto HasIndirectTailCall = [&](const BinaryFunction &BF) -> bool {
501-
for (const auto &BB : BF) {
502-
for (const auto &II : BB) {
503-
if (BC.MIB->isIndirectBranch(II) && BC.MIB->isTailCall(II)) {
504-
return true;
505-
}
506-
}
507-
}
508-
return false;
509-
};
510-
511-
if (BC.isAArch64() && BC.usesBTI() &&
512-
HasIndirectTailCall(*TargetFunction)) {
513-
++InstIt;
514-
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: Skipping inlining block with tailcall"
515-
<< " in " << Function << " : " << BB->getName()
516-
<< " to keep BTIs consistent.\n");
517-
continue;
518-
}
519-
520494
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: inlining call to " << *TargetFunction
521495
<< " in " << Function << " : " << BB->getName()
522496
<< ". Count: " << BB->getKnownExecutionCount()

bolt/test/AArch64/inline-bti.s

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)