[PATCH] D104854: Introduce intrinsic llvm.isnan

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 20 09:13:24 PDT 2021


xbolva00 added a comment.

In D104854#2957529 <https://reviews.llvm.org/D104854#2957529>, @spatel wrote:

> In D104854#2957471 <https://reviews.llvm.org/D104854#2957471>, @sepavloff wrote:
>
>> In D104854#2957423 <https://reviews.llvm.org/D104854#2957423>, @spatel wrote:
>>
>>> Is it intentional that we are not canonicalizing the intrinsic call back to `fcmp uno` in the default FP environment?
>>
>> It is lowered to unordered comparison by default. Changing `llvm.isnan` to  `fcmp uno` somewhere in IR would make it possible to optimize out the latter if fast-math mode is on. Preserving semantics of `isnan` when fast-math is in effect was one of the goals of this change.
>
> I understand that the codegen was supposed to be no worse, but the difference in IR causes optimizer regressions like: 
> https://llvm.org/PR51556
>
> If we want this intrinsic (and its siblings that haven't been created yet) to survive through IR, then we have to enhance IR passes to recognize the new patterns. 
> It would be easier to do this in steps: (1) create the intrinsic only if not in the default FP env, (2) update IR analysis/passes to recognize the intrinsic, (3) create the intrinsic in the default FP env with no FMF, (4) create the intrinsic always.

Meanwhile this should be reverted..


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104854



More information about the llvm-commits mailing list