[PATCH] D106362: [FPEnv][InstSimplify] Enable more folds for constrained fadd

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 29 10:47:14 PDT 2021


sepavloff added a comment.

In D106362#3030871 <https://reviews.llvm.org/D106362#3030871>, @kpn wrote:

> In D106362#3030856 <https://reviews.llvm.org/D106362#3030856>, @sepavloff wrote:
>
>> In D106362#3030790 <https://reviews.llvm.org/D106362#3030790>, @kpn wrote:
>>
>>> Changing the way the existing transforms check for FMF.noNaNs() sounds like a different ticket that needs to be done before this one can progress. Unless I misunderstood?
>>
>> I know nothing about such change.
>
> Your proposed changes around SNaN will affect the non-constrained cases.

I think the optimization `fadd X, -0 ==> X` in general case (not `FMF.noNaNs()`) is incorrect. The obtained values must be identical to what would produce hardware, otherwise it is not an optimization. If you think that such change deserves a separate patch, no problem. It seems to me that this patch could establish correct folding even if it changes non-constrained operation as well.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106362/new/

https://reviews.llvm.org/D106362



More information about the llvm-commits mailing list