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

Tobias Grosser tobias at grosser.es
Thu Sep 12 13:35:33 PDT 2013


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

Cheers,
Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Use-CodeGenOptions-to-derive-LLVM-IR-fast-math-flags.patch
Type: text/x-patch
Size: 4134 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130912/10b22183/attachment.bin>


More information about the cfe-commits mailing list