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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 08:30:56 PST 2020


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:472
+  // If the value is a constant, we can obviously see if it is a NaN or not.
+  if (const ConstantFP *FPVal = getConstantFPVRegVal(Val, MRI))
+    return !FPVal->getValueAPF().isNaN() ||
----------------
Braces


================
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;
+  }
----------------
Also G_BUILD_VECTOR_TRUNC


================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:477
+  if (DefMI->getOpcode() == TargetOpcode::G_BUILD_VECTOR) {
+    for (auto Op : DefMI->uses())
+      if (!isKnownNeverNaN(Op.getReg(), MRI, SNaN))
----------------
probably  should be const&


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

https://reviews.llvm.org/D91714



More information about the llvm-commits mailing list