Skip to content

Commit

Permalink
Outline indirect calls in swt
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel-Durov committed Feb 8, 2024
1 parent c470dd9 commit b723700
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions tests/c/unroll_safe_implies_noinline.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// # YKFIXME: outline indirect calls in swt.
// ignore-if: test "$YKB_TRACER" == "swt"
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YKD_PRINT_IR=aot
Expand Down
10 changes: 4 additions & 6 deletions yktracec/src/jitmodbuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1246,12 +1246,10 @@ class JITModBuilder {
assert(Idx + 1 < InpTrace.Length());
TraceLoc MaybeNextIB = InpTrace[Idx + 1];
if (const IRBlock *NextIB = MaybeNextIB.getMappedBlock()) {
auto isNextBlockNotEntry = NextIB->BBIdx > 0;
if (IsSWTrace && CI->isIndirectCall() && isNextBlockNotEntry) {
// With software tracing we don't get unmappable blocks when
// an indirect call target is unmappable. But we can check
// instead if the next block is an entry block. If it's not,
// the call target is unmappable and can't be inlined.
if (IsSWTrace) {
// YKFIXME: outline indirect calls in swt.
// Peeking ahead in swt might give us a mappable entry block,
// however we don't know if there was an umappable call in between.
CF = nullptr;
} else {
CF = AOTMod->getFunction(NextIB->FuncName);
Expand Down

0 comments on commit b723700

Please sign in to comment.