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

David Tweed david.tweed at arm.com
Mon Mar 18 05:25:52 PDT 2013


Hi,

I've just committed r177279,r177280 which fix a straight bug in the handling
of the vector case of floating point simplification

fadd X, (-0.0f) ==> X

in EarlyCSE. However, in the course of doing that I've had conversations
with some ARM LLVM users who feel that they want to be
able to have no simplification at all applied to floating point code, since
for various different floating point implementations (CPU-scalar,
CPU-vector, GPU) with various different rounding modes expressions like
"fadd X, (-0.0f)" and "X" can have different values;
even if this only happens in corner cases you'd not use in real code, from a
testing point of view it makes things much more complicated.
There's a reasonable view that, in some use cases, knowing that the code as
written will be make it to machine code is more important
than the occasional missed "acceptable" optimization.

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.

Cheers,
Dave 







More information about the llvm-commits mailing list