[LLVMdev] [RFC] Extend LLVM IR to express "fast-math" at a per-instruction level

Chris Lattner clattner at apple.com
Thu Nov 15 13:30:37 PST 2012

On Nov 14, 2012, at 7:37 PM, Chandler Carruth <chandlerc at google.com> wrote:

> On Wed, Nov 14, 2012 at 7:19 PM, Michael Ilseman <milseman at apple.com> wrote:
>> I see now that it's only binary operators that have OptimizationFlags
>> reserved for them in the bitcode. Adding fast-math flags for only binary ops
>> is straight-forward, but adding them for other ops might require a more
>> involved bitcode change.
> ...
>> Given all that, I think it makes sense to add support for fast-math flags
>> only to binary ops in this iteration, and think about adding it to other
>> operations in the future. Thoughts?

Michael: yes, starting with binary operators first makes perfect sense to me.

> I'm really not trying to rehash a discussion in too much depth, but I
> have to wonder with all of this -- why not use metadata as the
> *encoding* mechanism for these flags?

Chandler: Because it is heinously inefficient for something that gets applied to every FP operation, and because it violates the pattern established by NSW/NUW etc.  This was discussed in depth on the previous email thread.


More information about the llvm-dev mailing list