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] Remove Intrinsic::bpf_compare #95

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

LucasSte
Copy link
Collaborator

@LucasSte LucasSte commented Apr 2, 2024

Problem

The SBF target is still dependent on the BPF intrinsics. We depend on intrinsics unsupported in the SBF target or on intrinsics that are not necessary for our code generation. Intrinsic::bpf_compare exists to disable an LLVM optimization that might break the kernel BPF verifier. The SBF verifier does not contain the verification rule mentioned in the comment, so the optimization that the intrinsic disables can be turned back on.

If we wish to upstream the SBF target at some point, decreasing the dependency on BPF is beneficial.

Solution

I removed the IR adjustment that inserted the intrinsic and later removed it. This enables the optimization that converts (conv)a < power_2_const to a & <const>.

@LucasSte LucasSte requested a review from dmakarov April 4, 2024 13:53
@LucasSte LucasSte marked this pull request as ready for review April 4, 2024 13:53
@LucasSte LucasSte merged commit 1dd7575 into anza-xyz:solana-rustc/17.0-2023-12-14 Apr 9, 2024
14 checks passed
@LucasSte LucasSte deleted the no-icmp branch April 9, 2024 13:02
LucasSte added a commit to LucasSte/llvm-project that referenced this pull request Jun 28, 2024
LucasSte added a commit that referenced this pull request Aug 19, 2024
LucasSte added a commit to LucasSte/llvm-project that referenced this pull request Feb 12, 2025
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