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

[SOL] Better sBPFv1 sign extension #103

Draft
wants to merge 1 commit into
base: solana-rustc/17.0-2023-12-14
Choose a base branch
from

Conversation

ripatel-fd
Copy link

@ripatel-fd ripatel-fd commented Jul 4, 2024

Using "add32 reg, 0" for sign extension is more efficient than using "lsh reg, 32; arsh reg 32".

  • Write lit tests
  • Make sure Rust still compiles and tests pass
  • Verify if codegen improved for real Solana programs

_631ee818051efc6985667197-LLVM sBPF sign-extend optimzation-040724-143334.pdf

Using "add32 reg, 0" for sign extension is more efficient than
using "lsh reg, 32; arsh reg 32".
@LucasSte LucasSte changed the title [SBF] Better sBPFv1 sign extension [SOL] Better sBPFv1 sign extension Jul 4, 2024
@@ -185,6 +185,69 @@ bool SBFMIPeephole::eliminateZExtSeq() {
}

// Eliminate the 32-bit to 64-bit zero extension sequence when possible.
Copy link
Author

Choose a reason for hiding this comment

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

This is in the wrong place - This deals with sign extension, not zero extension

@ripatel-fd
Copy link
Author

@LucasSte Should I make the commits say "SOL" instead of "SBF"?

@LucasSte
Copy link
Collaborator

LucasSte commented Jul 4, 2024

@LucasSte Should I make the commits say "SOL" instead of "SBF"?

Yes, this is what we've been using in the history.

@LucasSte
Copy link
Collaborator

Are you still interested in getting this PR merged?

I have updated compiler to LLVM 18, so would you mind opening the PR again the solana-rustc/18.1-2024-05-19 branch?

@ripatel-fd
Copy link
Author

Are you still interested in getting this PR merged?

I have updated compiler to LLVM 18, so would you mind opening the PR again the solana-rustc/18.1-2024-05-19 branch?

Yes, I'll rebase, thanks for letting me know.

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.

3 participants