[all-commits] [llvm/llvm-project] e7c63c: [libc++] Stop using __builtin_assume in _LIBCPP_AS...

Louis Dionne via All-commits all-commits at lists.llvm.org
Thu Jun 29 14:01:29 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e7c63c0e90a952f6e6fdd40f9d27b2e8338dd4ac
      https://github.com/llvm/llvm-project/commit/e7c63c0e90a952f6e6fdd40f9d27b2e8338dd4ac
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2023-06-29 (Thu, 29 Jun 2023)

  Changed paths:
    M libcxx/include/__assert
    M libcxx/src/filesystem/posix_compat.h

  Log Message:
  -----------
  [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




More information about the All-commits mailing list