Skip to content
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

Allow instruction combine in SBF #112

Merged

Conversation

LucasSte
Copy link
Collaborator

This PR removes code that added a passthrough function in SBF (they were originally from the BPF target), which prevented LLVM's instruction combine pass to run. Their original purpose was to appease the kernel verifier. As a result, we now combine jumps.

Old code generation:

lsh64 r1, 32
arsh64 r1, 32
mov64 r2, 1
jsgt r2, r1, LBB0_3
jsgt r1, 7, LBB0_3

New code generation:

add64 r2, -8
lsh64 r2, 32
rsh64 r2, 32
lddw r3, 4294967289
jgt r3, r2, LBB0_2

@LucasSte LucasSte requested a review from dmakarov November 19, 2024 21:39
@LucasSte LucasSte marked this pull request as ready for review November 19, 2024 21:39
@LucasSte LucasSte merged commit 77c4da7 into anza-xyz:solana-rustc/18.1-2024-05-19 Nov 19, 2024
17 checks passed
@LucasSte LucasSte deleted the allow-combine branch November 19, 2024 22:04
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