Skip to content

Add yklocations to recursive-via-tail-call functions. - #151

Merged
ltratt merged 1 commit into
ykjit:mainfrom
ltratt:recursive_tail_calls
Jul 21, 2026
Merged

Add yklocations to recursive-via-tail-call functions.#151
ltratt merged 1 commit into
ykjit:mainfrom
ltratt:recursive_tail_calls

Conversation

@ltratt

Copy link
Copy Markdown
Contributor

Before this commit, tail calls bypassed our "spot recursive functions and add a YkLocation to them" check. The p->called in this commit fixes that problem but we then need to account for the fact that this means the caller function has implicitly returned: if it isn't the current function we need to mark it as uncalled.

As before, this heuristic isn't perfect, but it solves an obvious limitation in yklua, though it doesn't make much difference to actual benchmarks.

Before this commit, tail calls bypassed our "spot recursive functions
and add a `YkLocation` to them" check. The `p->called` in this commit
fixes that problem _but_ we then need to account for the fact that this
means the caller function has implicitly returned: if it _isn't_ the
current function we need to mark it as uncalled.
As before, this heuristic isn't perfect, but it solves an obvious
limitation in yklua, though it doesn't make much difference to actual
benchmarks.
@ltratt
ltratt enabled auto-merge July 21, 2026 14:50
@ltratt
ltratt added this pull request to the merge queueJul 21, 2026
Merged via the queue into ykjit:main with commit 7703638Jul 21, 2026
2 checks passed
@ltratt
ltratt deleted the recursive_tail_calls branch July 21, 2026 15:02
Sign up for freeto 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.

1 participant

@ltratt