[all-commits] [llvm/llvm-project] a784de: [flang] Add -ffp-contract option processing

Tom Eccles via All-commits all-commits at lists.llvm.org
Mon Oct 31 04:37:10 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a784de783af5096e593c5e214c2c78215fe303f5
      https://github.com/llvm/llvm-project/commit/a784de783af5096e593c5e214c2c78215fe303f5
  Author: Tom Eccles <Tom.Eccles at arm.com>
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticDriverKinds.td
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/ToolChains/Flang.cpp
    M flang/include/flang/Frontend/CompilerInvocation.h
    A flang/include/flang/Frontend/LangOptions.def
    A flang/include/flang/Frontend/LangOptions.h
    M flang/lib/Frontend/CMakeLists.txt
    M flang/lib/Frontend/CompilerInvocation.cpp
    A flang/lib/Frontend/LangOptions.cpp
    M flang/test/Driver/driver-help-hidden.f90
    M flang/test/Driver/driver-help.f90
    M flang/test/Driver/flang_f_opts.f90
    A flang/test/Driver/flang_fp_opts.f90
    M flang/test/Driver/frontend-forwarding.f90

  Log Message:
  -----------
  [flang] Add -ffp-contract option processing

Only add the option processing and store the result. No attributes are
added to FIR yet.

Only the "off" and "fast" options are supported. "fast-honor-pragmas" is not applicable because we do not implement `#pragma clang fp contract()` in Fortran [1]. "on" is not supported because it is unclear how to fuse only within individual statements. gfortran also does not implement "on": treating it as an "off".

Currently the default value is "off" to preserve existing behavior. gfortran uses "fast" by default and that may be the right thing for flang-new after further discussion in the future, but that can be changed separately. gfortran's documentation is available [[ https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html | here ]].

[1] https://clang.llvm.org/docs/LanguageExtensions.html#extensions-to-specify-floating-point-flags

Reviewed By: vzakhari, awarzynski

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




More information about the All-commits mailing list