[PATCH] D104410: GlobalISel/Utils: Refactor constant splat match functions

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 17 05:08:23 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:987
+                                                 bool AllowUndef) {
+  // Match as any constant and get APFloat from Reg. Allows nan splat matching.
+  if (auto SplatValAndReg = getAnyConstantSplat(VReg, MRI, AllowUndef))
----------------
Petar.Avramovic wrote:
> foad wrote:
> > What does "Allows nan splat matching" mean?
> Splat of NaN value, if we get value as APFloat all comparisons with it are false and we cant check for splat. We check for splat using APInt and check if constant is g_fconstant with getFConstantVRegValWithLookThrough and get APFloat.
OK, I just assumed that any floating point splat detection code would use bitwiseIsEqual instead of operator== anyway.


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

https://reviews.llvm.org/D104410



More information about the llvm-commits mailing list