Skip to content

Conversation

@vext01
Copy link

@vext01 vext01 commented Dec 10, 2025

We use a wrapper so we can use an ABI that disrupts register allocation in the interpreter code to a lesser extent. The wrapper is required because the actual recorder function is defined in the JIT runtime's shared object and we can't change the ABI for library calls.

Benchmarking suggests some decent speedup for a handful of benchmarks, mostly in the 2%-10% range.

llvm::Function *TraceFunc = Function::Create(
FType, llvm::Function::InternalLinkage, YK_TRACE_FUNCTION_WRAPPER, M);
TraceFunc->setCallingConv(llvm::CallingConv::PreserveAll);
TraceFunc->addFnAttr(YK_OUTLINE_FNATTR);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As is often the case: raise a PR, spot a potential tweak.

I'm just wondering if I should mark the wrapper noinline...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we mind if it's inlined: in a sense, we do the "right thing" no matter which stack frame we run things in.

[That said, my guess would be that LLVM won't inline functions with this ABI. But I could be wrong about that.]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, shall we try this as-is then?

@ltratt ltratt removed this pull request from the merge queue due to a manual request Dec 10, 2025
@ltratt ltratt added this pull request to the merge queue Dec 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 10, 2025
We use a wrapper so we can use an ABI that disrupts register allocation
in the interpreter code to a lesser extent. The wrapper is required
because the actual recorder function is defined in the JIT runtime's
shared object and we can't change the ABI for library calls.

Benchmarking suggests some decent speedup for a handful of benchmarks,
mostly in the 2%-10% range.
@vext01 vext01 force-pushed the lightweight-swt-abi branch from 5004858 to fc2b633 Compare December 10, 2025 13:27
@vext01
Copy link
Author

vext01 commented Dec 10, 2025

Force pushed a fix.

@ltratt ltratt added this pull request to the merge queue Dec 10, 2025
Merged via the queue into ykjit:main with commit d6e6833 Dec 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants