[PATCH] Use CodeGenOptions to derive LLVM-IR fast math flags

Tobias Grosser tobias at grosser.es
Mon Sep 30 06:09:53 PDT 2013


On 09/12/2013 10:35 PM, Tobias Grosser wrote:
> Hi,
>
> I would like to submit the following patch for review:
>
> [PATCH] Use CodeGenOptions to derive LLVM-IR fast math flags
>
> The clang driver goes a long way to properly detangle the interactions
> of the different fast math driver flags (test/Driver/fast-math.c). The
> subsequent call to clang -cc1 then uses the CodeGenOption flags to set
> the valid optimizations and it uses the LangOptions to enable the
> relevant fast math macros.
>
> When deriving the LLVM-IR fast math flags we use the CodeGenOptions,
> instead of the previously used LangOptions. This ensures that
> optimizations for the following command line are disabled, while the
> fast math macro is still set:
>
> clang -ffast-math -fno-finite-math-only -fno-unsafe-math-optimizations
> file.c

Ping.

Tobias




More information about the cfe-commits mailing list