[PATCH] D116702: [GlobalISel] Combine select + fcmp to fminnum/fmaxnum/fminimum/fmaximum

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 10 16:44:08 PST 2022


aemerson added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:5348
+unsigned CombinerHelper::getFPMinMaxOpcForSelect(
+    unsigned Pred, LLT DstTy, SelectPatternNaNBehaviour VsNaNRetVal) const {
+  assert(VsNaNRetVal != NOT_APPLICABLE && "Expected a NaN behaviour?");
----------------
Can this be the actual Predicate type instead of unsigned?


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:5376-5379
+    if (isLegalOrBeforeLegalizer({TargetOpcode::G_FMINNUM, {DstTy}}))
+      return TargetOpcode::G_FMINNUM;
+    else if (isLegalOrBeforeLegalizer({TargetOpcode::G_FMINIMUM, {DstTy}}))
+      return TargetOpcode::G_FMINIMUM;
----------------
What's the reason for choosing this particular ordering of legality checks such that we prefer G_FMINNUM?


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

https://reviews.llvm.org/D116702



More information about the llvm-commits mailing list