[LLVMdev] Representing -ffast-math at the IR level

Renato Golin rengolin at systemcall.org
Sat Apr 14 12:51:10 PDT 2012


On 14 April 2012 20:34, Duncan Sands <baldrick at free.fr> wrote:
> the verifier checks that the accuracy operand is either a floating point
> number (ConstantFP) or the keyword "fast".  If "Accuracy" is zero here
> then that means it wasn't ConstantFP.  Thus it must have been the keyword
> "fast".

I think it's assuming too much. If I write "foobar", it'd also work as
"fast", or even worse, if I write "strict"...

I'm not an expert in FP transformations, but as Dmitry said, there
could be more than one "fast" transformations. Maybe that should be an
enum somewhere, rather than an accuracy.

Can you accurately propagate accuracy ratios across multiple
instructions? Through multiple paths and PHI nodes? Not to mention
that the "Accuracy" is also FP, which has its own accuracy problems...
sigh...


> This kind of metadata must only relax IEEE strictness (and never tighten
> it) because *metadata can always be discarded*.  Discarding it must never
> result in wrong IR/transforms, thus metadata can only give additional
> permissions.

Makes sense.


-- 
cheers,
--renato

http://systemcall.org/




More information about the llvm-dev mailing list