[PATCH] D91714: AMDGPU/GlobalISel: Check values of constants in isKnownNeverNaN

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 08:40:19 PST 2020


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:476-481
+  if (DefMI->getOpcode() == TargetOpcode::G_BUILD_VECTOR) {
+    for (auto Op : DefMI->uses())
+      if (!isKnownNeverNaN(Op.getReg(), MRI, SNaN))
+        return false;
+    return true;
+  }
----------------
Petar.Avramovic wrote:
> arsenm wrote:
> > Also G_BUILD_VECTOR_TRUNC
> I thought that G_BUILD_VECTOR_TRUNC and G_ANYEXT would have to be handled also but I don't have test for them. Might be required depending on order in with instructions are legalized (G_BUILD_VECTOR_TRUNC is not generated before legalizer). Should I add them anyway?
What does G_BUILD_VECTOR_TRUNC do on floating point types? Is it like G_TRUNC or G_FPTRUNC?


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

https://reviews.llvm.org/D91714



More information about the llvm-commits mailing list