Inline indirect calls where possible.#2135
Merged
ltratt merged 1 commit intoykjit:masterfrom Mar 20, 2026
Merged
Conversation
Contributor
|
@vext01 Is this one worth considering now? |
Contributor
Author
|
I think if this has to performance issues on yklua, it can go in. Let me measure and get back to you. |
Contributor
Author
|
|
ltratt
reviewed
Mar 19, 2026
ykrt/src/compile/j2/aot_to_hir.rs
Outdated
| panic!() | ||
| }; | ||
| if let Some(fname) = self.j2.dladdr(*vaddr) { | ||
| use std::ffi::CString; |
Contributor
There was a problem hiding this comment.
Please force push this use up to the top-level.
Contributor
Author
|
Force pushed the fix. |
Requirements: - constant function pointer - non-yk_outline callee `__attribute__((yk_inline_indirect))` can be used to prevent functions only targeted by indirect calls from being marked `yk_outline` by ykllvm.
Contributor
Author
|
pushed the clippy fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Raising this so it doesn't get forgotten.
This allows indirect calls to be inlined in some circumstances.
Requirements:
__attribute__((yk_inline_indirect))can be used to prevent functions only targeted by indirect calls from being markedyk_outlineby ykllvm.I experimented with this change a lot in ykmicropython. I was able to get quite a lot of indirect calls inlined, but sadly it didn't make a big performance difference to the mandelbrot benchmark I was trying to optimise.
Note that I have not benchmarked this on yklua. There is potential for a performance change (in either direction!), so me might want to benchmark it first. In light of this, raising as a draft.