[all-commits] [llvm/llvm-project] e7b666: [flang] Add -ffast-math and -Ofast

Tom Eccles via All-commits all-commits at lists.llvm.org
Fri Dec 9 11:57:07 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e7b6660243d1a4548f7aaac992b777ef0f0ba5b7
      https://github.com/llvm/llvm-project/commit/e7b6660243d1a4548f7aaac992b777ef0f0ba5b7
  Author: Tom Eccles <tom.eccles at arm.com>
  Date:   2022-12-09 (Fri, 09 Dec 2022)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/ToolChains/Flang.cpp
    M flang/docs/FlangDriver.md
    M flang/lib/Frontend/CompilerInvocation.cpp
    M flang/test/Driver/driver-help-hidden.f90
    M flang/test/Driver/driver-help.f90
    A flang/test/Driver/fast_math.f90
    M flang/test/Driver/frontend-forwarding.f90
    M flang/test/Lower/fast-math-arithmetic.f90

  Log Message:
  -----------
  [flang] Add -ffast-math and -Ofast

clang -cc1 accepts -Ofast. I did not add it to flang -fc1 because this
seems redundant because the compiler driver will always resolve -Ofast
into -O3 -ffast-math (I added a test for this).

-menable-infs is removed from the frontend-forwarding test because if
all of the fast-math component flags are present, these will be resolved
into the fast-math flag. Instead -menable-infs is tested in the
fast-math test.

Specifying -ffast-math to the compiler driver causes linker invocations
to include crtfastmath.o.

RFC: https://discourse.llvm.org/t/rfc-the-meaning-of-ofast/66554

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




More information about the All-commits mailing list