[all-commits] [llvm/llvm-project] adeae9: [libc++] Make _LIBCPP_ASSUME usable when it is app...
David Benjamin via All-commits
all-commits at lists.llvm.org
Tue Sep 17 08:22:49 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: adeae925dcd7db0d49256f687c66a662d6604128
https://github.com/llvm/llvm-project/commit/adeae925dcd7db0d49256f687c66a662d6604128
Author: David Benjamin <davidben at google.com>
Date: 2024-09-17 (Tue, 17 Sep 2024)
Changed paths:
M libcxx/include/__assert
Log Message:
-----------
[libc++] Make _LIBCPP_ASSUME usable when it is appropriate (#91801)
libc++ turned off _LIBCPP_ASSUME because turning every debug assert into
__builtin_assume tripped [1]. However, this means we can't use _LIBCPP_ASSUME
when there is a clear optimization intent. See [2] for discussion of a place
where _LIBCPP_ASSUME would be valuable.
This patch fixes this by not undefining the definition of _LIBCPP_ASSUME and
making sure that we don't attempt to `_LIBCPP_ASSSUME` every assertion in
the library.
[1]: https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609
[2]: https://github.com/llvm/llvm-project/pull/78929#issuecomment-1936582711
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list