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

[libc++] Make _LIBCPP_ASSUME usable when it is appropriate #91801

Merged
merged 2 commits into from
Sep 17, 2024

Commits on Sep 17, 2024

  1. Make _LIBCPP_ASSUME usable when it is appropriate

    libc++ turned off _LIBCPP_ASSUME because turning every debug assert into
    __builtin_assume tripped
    https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609
    
    However, this means we can't use _LIBCPP_ASSUME when there is a clear
    optimization intent. See
    llvm#78929 (comment)
    for discussion of a place where _LIBCPP_ASSUME would be valuable.
    
    Go ahead and fix this now, and adjust the comments. I don't think we
    want _LIBCPP_ASSUME in disabled asserts anyway, at least not in any of
    the hardened modes. This PR should have no impact on libc++ right
    now, since _LIBCPP_ASSUME is currently never called standalone, but I
    figure I can do this as a standalone PR since it's pretty
    straightforward.
    davidben committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    f2cfe68 View commit details
    Browse the repository at this point in the history
  2. Remove comment

    davidben committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    a01582a View commit details
    Browse the repository at this point in the history