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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 13 23:24:04 PST 2022


foad added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:822
+
+  if (Mask == fcNan && !IsStrict) {
+    // Equivalent of isnan. Replace with standard fcmp.
----------------
Seems like you should handle `Mask == (fcAllFlags & ~fcNan)` here too. Same for the other `Mask ==` cases below. And allow InstCombine to "freely invert" this intrinsic by flipping all bits in the mask.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:845
+  const ConstantFP *CVal = dyn_cast<ConstantFP>(Src0);
+  if (!CVal) {
+#if 0
----------------
What's this `!CVal` check for?


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

https://reviews.llvm.org/D137811



More information about the llvm-commits mailing list