[LLVMdev] [llvm-commits] [PATCH] fast-math patches!
milseman at apple.com
Fri Nov 16 09:35:10 PST 2012
On Nov 15, 2012, at 8:07 PM, Joe Abbey <joe.abbey at gmail.com> wrote:
> Overall the code looks good.
> 2046 FMF.UnsafeAlgebra = 0 != (Record[OpNum] & (1 << bitc::FMF_UNSAFE_ALGEBRA));
> 2047 FMF.NoNaNs = 0 != (Record[OpNum] & (1 << bitc::FMF_NO_NANS));
> 2048 FMF.NoInfs = 0 != (Record[OpNum] & (1 << bitc::FMF_NO_INFS));
> 2049 FMF.NoSignedZeros = 0 != (Record[OpNum] & (1 << bitc::FMF_NO_SIGNED_ZEROS));
> 2050 FMF.AllowReciprocal = 0 != (Record[OpNum] & (1 << bitc::FMF_ALLOW_RECIPROCAL));
> I found some more in BitcodeReader::ParseConstants(), which I'll scrub after this commits.
> Will there be a // fmul N 1, x ==> x? perhaps a // fadd N S 0, x ==> x? as well as other arithmetic identities?
Yes, that is the intent. You can see more examples in the original RFC. For you specific examples:
> fmul N 1, x ==> x
I think that the 'N' (now spelled 'nnan') flag isn't relevant to the optimization, as NaN * 1 ==> NaN.
> fadd N S 0, x ==> x
Again, 'N' shouldn't apply. I don't think 'S' ('nsz') is needed here either, but it would be if it was x - 0 ==> x.
> On Nov 15, 2012, at 9:54 PM, Michael Ilseman <milseman at apple.com> wrote:
>> Another round of improved patches, and a patch for documentation changes to LangRef.
>> * Make comments more up to date
>> * Use 'arcp' instead of 'ar'
>> * Use logical ||
>> Still based off of r168110
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev