[PATCH] D149729: [X86] Avoid usage constant NaN for fminimum/fmaximum lowering

Evgenii Kudriashov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 18:39:24 PDT 2023


e-kud added a comment.

Good catch! Missed that we don't need to check `Y` on `NaN` because it is already a result of `min` therefore we can get rid of `NaN` loading.



================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:30258
   // X        ---------------  X      ---------------
   //    xNaN  | qNaN | qNaN |     -0  |  +0  |  -0  |
   //          ---------------         ---------------
----------------
Since now we return one of NaNs. Could you please update the table as well?


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:30283
+  if (IgnoreSingedZero || IsPreferredZero(Y) || DAG.isKnownNeverZeroFloat(X)) {
   } else if (IsPreferredZero(X) || DAG.isKnownNeverZeroFloat(Y)) {
+    NewX = Y;
----------------
This is a little out of code-style to have an empty `if`. I don't see any of it in `lib/Target/X86`. Can we reorganize somehow to avoid it?


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

https://reviews.llvm.org/D149729



More information about the llvm-commits mailing list