[LLVMdev] some thoughts on the semantics of !fpmath

Dan Gohman gohman at apple.com
Tue Apr 17 11:12:42 PDT 2012


On Apr 17, 2012, at 12:58 AM, Anton Korobeynikov <anton at korobeynikov.info> wrote:

> Hi Dan,

Hi Anton,

>> The !fpmath metadata violates the original spirit of
>> metadata, which is that metadata is only supposed to exclude
>> possible runtime conditions, rather than to introduce new
>> possible runtime possibilities.
> This was already violated by objc-specific metadata

Well, ObjC violates a lot more of LLVM IR semantics than just metadata.
Whether this is a problem or not depends on your perspective, I guess.

> and if I get Chris
> right - this is the intended behavior.


In Chris' own blog post on the subject [0], the first design
goal of metadata is that:

"Optimizations shouldn't be affected by metadata unless they explicitly try to look at it."

Now, it is debatable whether this is actually feasible. Maybe it
is too restrictive, and that it would be better to just require
every pass and every backend to be aware of every kind of
officially recognized metadata, as needed. It seems that several
people are starting to think this way.

[0] http://blog.llvm.org/2010/04/extensible-metadata-in-llvm-ir.html

Dan




More information about the llvm-dev mailing list