[all-commits] [llvm/llvm-project] e77321: [clang][patch] Add builtin __arithmetic_fence and ...

Melanie Blower via All-commits all-commits at lists.llvm.org
Wed Jun 30 06:58:27 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e773216f46368cd927a3c67bfa2516913acb75e7
      https://github.com/llvm/llvm-project/commit/e773216f46368cd927a3c67bfa2516913acb75e7
  Author: Melanie Blower <melanie.blower at intel.com>
  Date:   2021-06-30 (Wed, 30 Jun 2021)

  Changed paths:
    M clang/docs/UsersManual.rst
    M clang/include/clang/Basic/Builtins.def
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Basic/LangOptions.def
    M clang/include/clang/Basic/TargetInfo.h
    M clang/include/clang/Driver/Options.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/Basic/TargetInfo.cpp
    M clang/lib/Basic/Targets/X86.h
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Sema/SemaChecking.cpp
    M clang/lib/Sema/SemaCoroutine.cpp
    M clang/lib/Sema/SemaExpr.cpp
    A clang/test/AST/arithmetic-fence-builtin.c
    A clang/test/CodeGen/arithmetic-fence-builtin.c
    M clang/test/Driver/clang_f_opts.c
    A clang/test/Sema/arithmetic-fence-builtin.c

  Log Message:
  -----------
  [clang][patch] Add builtin __arithmetic_fence and option fprotect-parens

This patch adds a new clang builtin, __arithmetic_fence. The purpose of the
builtin is to provide the user fine control, at the expression level, over
floating point optimization when -ffast-math (-ffp-model=fast) is enabled.
The builtin prevents the optimizer from rearranging floating point expression
evaluation. The new option fprotect-parens has the same effect on
parenthesized expressions, forcing the optimizer to respect the parentheses.

Reviewed By: aaron.ballman, kpn

Differential Revision: https://reviews.llvm.org/D100118




More information about the All-commits mailing list