[cfe-dev] -fdenormal-fp-math

Evandro Menezes via cfe-dev cfe-dev at lists.llvm.org
Fri Mar 17 08:19:11 PDT 2017


On 03/17/2017 10:13 AM, Stephen Canon wrote:
>> On Mar 17, 2017, at 10:40 AM, Hal Finkel via cfe-dev <cfe-dev at lists.llvm.org> wrote:
>>
>>
>> On 03/17/2017 09:37 AM, Evandro Menezes wrote:
>>> On 03/16/2017 02:09 PM, Hal Finkel wrote:
>>>>
>>>> On 03/16/2017 12:43 PM, Evandro Menezes wrote:
>>>>> Hal,
>>>>>
>>>>> Would it be feasible for clang to generate crtfastmath.o on the fly at link time, by using LLVM to emit the object file?
>>>> We could. We could also just inject the necessary IR into each module as a linkonce_odr initialization function. I'm not sure it is worthwhile; we depend on compiler-rt for a lot of optional features.
>>> OTOH, by making sure that a module contains this code when any function is relaxing the FP semantics, even if the link command line doesn't include -ffast-math, the expected behavior can be guaranteed.
>> I'm not sure that's desirable. The problem is that these are global settings, and so we need to decide whether the flag on any translation unit will affect all others, or if we need the flag at link time for something that affects the entire application. I lean toward the latter.
> Right; setting fast-math on one translation unit should not effect the behavior of another translation unit.

Got it.

So, right now this only works if libgcc is available.  Would it be a 
good idea to add it to compiler-rt when it is not?

Thank you,

-- 
Evandro Menezes




More information about the cfe-dev mailing list