[LLVMdev] some thoughts on the semantics of !fpmath

Renato Golin rengolin at systemcall.org
Tue Apr 17 09:16:16 PDT 2012


2012/4/17 Hal Finkel <hfinkel at anl.gov>:
> In reality, metadata might want to have merging rules and a defined API
> so that metadata merging can be used by a number of passes
> (vectorization will need this too). For example, merging fp-accuracy
> data should choose the more-stringent bound, but not really be removed
> all together.

+1!

The original intent of metadata was to represent spurious concepts,
and the design was that is was always safe to ignore more to avoid the
complex semantics than specific intent.

Debug data should never be discarded if the user specified -g. It can
be merged, changed, but never discarded. Otherwise, what's the point?

Vectorisation the same, if you do some transformation based on one
information and need a subsequent pass to finish the same
transformation, and you destroy the metadata, you get incorrect
results.

With FP precision, you might be able to use different instructions or
ignore specific traps on more relaxed models, and the back-end can
only know that if you kept the metadata until the end.

I appreciate the cost of strict metadata semantics to the IR, but I
think we're at a point that either we use a decent metadata engine or
none at all.

-- 
cheers,
--renato

http://systemcall.org/



More information about the llvm-dev mailing list