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

Chris Lattner clattner at apple.com
Wed Nov 14 12:47:57 PST 2012


On Nov 14, 2012, at 12:28 PM, Michael Ilseman <milseman at apple.com> wrote:

> I think I missed what problem we're trying to solve here.
> 
> I'm looking at implementing the bitcode now. I have code to successfully read and write out the LLVM IR textual formal (LLParser, etc) and set the corresponding SubclassOptionalData bits. Looking at LLVMBitCodes.h, I'm seeing where these bits reside in the bitcode, so I believe that things should be pretty straight-forward from here.
> 
> Joe, what are the reasons for me to increment the IR version number? My understanding is that I'll just be using existing bits that were previously ignored. Ignoring these bits is still valid, just conservative. I believe these flags would be zero-ed out in old IR (correct me if I'm wrong), which is the intended default.

Yes, this is the right thing, just make the sense of the bits in the bitcode file be "1" for cases that differs from the old default.

> Chris, what problem could be solved by adding extra operands to binary ops? I'm trying to avoid those sorts of modifications, as the fast-math flags could make sense applied to a variety operations, e.g. comparisons and casts.

How, specifically, are you proposing that these bits be encoded?

-Chris




More information about the llvm-dev mailing list