Should we have a "don't simplify floating point at all" flag?

Duncan Sands baldrick at free.fr
Mon Mar 18 08:40:38 PDT 2013


Hi David,

>> What would the community feel about the addition of a flag which led to
> the
>> behaviour of not applying any simplification to
>> floating point instructions (but only affecting those simplifications)? I
>> should stress that we're not committing to implementing this,
>> more getting a feel for if it's worth investigating feasibility some more.
>
> | I think it would be better to add more information to the IR so that the
> | optimizers can make correct decisions.  For example, LLVM has been lacking
> | proper support for rounding modes forever, maybe now is a good time to fix
> that?
>
> That may be the better long-term solution. One of the issues is that it's
> often
> a combination of the "set rounding mode" with fixed features of the hardware
> (eg, the hardware only offers flush-denormals-to-zero behaviour) that
> affects
> things. I haven't (at least yet) really looked in any detail at just how
> complex
> all this gets.

I have no idea what would be the best approach for representing all this in the
IR.  If it isn't feasible to have a system that covers every case, we can
always have a "funky" mode (for example) which causes the optimizers to not make
any assumptions about how floating point works, in effect disabling most
floating point optimizations.

Ciao, Duncan.



More information about the llvm-commits mailing list