Skip to content

Implement branch prediction intrinsics #20579

Closed

Description

@nagisa

Branch prediction intrinsic equivalent to GCC’s __builtin_expect should exist. Alternatively two intrinsics likely and unlikely could be implemented.

Activity

  1. nagisa commented on Jan 5, 2015

    @nagisa
    MemberAuthor

    Appears to correspond to llvm.expect intrinsic.

  2. jdm commented on Jan 5, 2015

    @jdm
    Contributor

    See #17317.

  3. nagisa commented on Jan 5, 2015

    @nagisa
    MemberAuthor

    I’m be fine with only expect_u* exposed from core::intrinsics. That wouldn’t need any RFC I think. While likely! and unlikely! are nice-to-have, they are simple enough to define in terms of the intrinsics.

  4. alexcrichton commented on Feb 28, 2015

    @alexcrichton
    Member

    cc @steveklabnik, could this move to the rust-lang/rfcs repo? (feature request)

  5. added a commit that references this issue on Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions