[PATCH] D137811: InstCombine: Port amdgcn.class intrinsic combines to is.fpclass

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 23:30:35 PST 2022


sepavloff added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:842
+    // Equivalent of isnan. Replace with standard fcmp.
+    Value *FCmp = Builder.CreateFCmpUNO(Src0, Src0);
+    FCmp->takeName(&II);
----------------
arsenm wrote:
> sepavloff wrote:
> > This replacement is not valid in general case, only if FP exceptions are ignored. If the argument is a signaling NaN, compare instruction raises `Invalid` exception.
> Isn't that implied by not being a constrained intrinsic?
> 
`is_fpclass` does not depend on FP environment and does not change it. So it does not have constrained variant.


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

https://reviews.llvm.org/D137811



More information about the llvm-commits mailing list