[libc++] Stop using __builtin_assume in _LIBCPP_ASSERT
__builtin_assume can sometimes worsen code generation. For now, the guideline seems to be to avoid adding assumptions without a clear optimization intent. Since _LIBCPP_ASSERT is very general, we can't have a clear optimization intent at this level, which makes __builtin_assume the wrong tool for the job -- at least until __builtin_assume is changed. See https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609 for a discussion of this. Differential Revision: https://reviews.llvm.org/D153968
Loading
Please sign in to comment