Skip to content

Register spilling #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
brandonros opened this issue May 5, 2025 · 0 comments
Open

Register spilling #210

brandonros opened this issue May 5, 2025 · 0 comments

Comments

@brandonros
Copy link

I have some code. If I #[inline(always)] it, performance is fantastic (4,000,000 operations/sec)

Drawback: the code silently corrupts itself. I don't know exactly what it is but, when I #[inline(never)], the problem goes away but performance goes down to 500,000 operations/second

Is this normal even outside of this Rust compiler or is it a side effect of using the Rust compiler? Could it be detected?

If the compiler knows the maximum registers per thread is ~256 (or whatever) and with all this inlined code it surpasses 256 and something will get corrupted, could it fail so the user it not left running code that they don't realize is actually incorrect until much later?

I can provide more if desired. It is ed25519 code.

If I put no inline marker, it'll do the same behavior #[inline(always)] JIT wise I guess, which means "silent corruption" in my case.

I had to know ahead of time this code needs to not be inlined. Is there a #[volatile] or something I should be putting? Device fence mark? Thread sync?

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

No branches or pull requests

1 participant