[PATCH] D135447: [AMDGPU] Add llvm.is.fpclass intrinsic to existing SelectionDAG fp class support and introduce GlobalISel implementation for AMDGPU

Janek van Oirschot via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 06:57:55 PST 2022


JanekvO added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-fpclass-flags.ll:16
+}
+
+declare i1 @llvm.is.fpclass.f32(float, i32)
----------------
arsenm wrote:
> Needs additional checks with other flags besides the one just set
I've been wondering whether the flag copy from the IR intrinsic to G_IS_FPCLASS in IRTranslator should be removed altogether. I'd have to weaken the flags' constraints as they all require scalar or vector fp return types. Additionally, Any use of fast math flags outside of existing uses will most likely require amending langref. E.g., current descriptions of some fast math flags describe how input can result into a poison value but this wouldn't be possible for G_IS_FPCLASS as it's a bool return.

Let me know what you think, I can see some of the flags being useful by folding into constant bool values (e.g., not a nan flag + G_IS_FPCLASS test for nans) but I may be a bit naïve on useful cases beyond said folding.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135447



More information about the llvm-commits mailing list