Skip to content

Rust compiler or LLVM fails to generate branch-free code #106490

@Sword-Smith

Description

@Sword-Smith

Not a bug but a missed opportunity to generate fast code.

In some instances the Rust compiler generates faster code when if/else branching is used than when "branch-free" arithmetical functions are used.

This results in code that's significantly slower than it should be.

This problem is documented in the following PR.
Neptune-Crypto/twenty-first#70

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-slowIssue: Problems and improvements with respect to performance of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions