[llvm-dev] Question on fast-math optimizations

Heiko Becker via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 30 07:23:13 PST 2018


Thank you once again for the further clarifications.

I still have one more question:

What is the canoncial source for getting a definitive answer on which 
optimizations are applied when, when allowing fastmath optimizations in 
LLVM?

A pointer to a source file would also be fine. It is just that I tried 
searching on http://releases.llvm.org/7.0.0/docs/Passes.html and did not 
find any information there, so I am feeling a bit lost.

Thank you,

Heiko

On 11/30/18 3:34 PM, Stephen Canon via llvm-dev wrote:
>> On Nov 30, 2018, at 9:24 AM, Nicolai Hähnle via llvm-dev 
>> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>>
>> Stephen was a bit hesitant about what to call the x * (y + 1) --> x * 
>> y + x FMA-introducing transform on the grounds that it superficially 
>> only seems to improve the precision at which the expression is evaluated.
>
> It’s a little bit more subtle than that; because FMA is computed 
> without internal rounding, under an as-if model, you can’t 
> differentiate between fma(x, y, x) and a hypothetical 
> correctly-rounded x*(y + 1), so it doesn’t even make sense to talk 
> about “distributivity” in this context ...
>
>> My point was that this very same transform can introduce very 
>> significant, qualitative differences in the result when inf is involved.
>
> … except with regard to inf/nan edge cases, as you correctly pointed 
> out. =)
>
> – Steve
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181130/75f11e10/attachment.html>


More information about the llvm-dev mailing list