[PATCH] D81940: [flang] AMAX0, MIN1... rewrite to MAX/MIN: make result conversion explicit

Peter Klausler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 10:27:12 PDT 2020


klausler accepted this revision.
klausler added inline comments.
This revision is now accepted and ready to land.


================
Comment at: flang/lib/Evaluate/fold-implementation.h:700
+      }
+    } else if (resultType.category() == TypeCategory::Integer) {
+      resultTypeArg = &args[j];
----------------
Why is this limited to `INTEGER` here?  Do `AMAX0`, `AMIN0`, `DMAX1`, and `DMIN1` have separate handling elsewhere?


================
Comment at: flang/lib/Evaluate/fold-integer.cpp:426
     return FoldMINorMAX(context, std::move(funcRef), Ordering::Greater);
+  } else if (name == "max1" || name == "min1" || name == "max0" ||
+      name == "min0") {
----------------
Since these are in alphabetical order, you should put the "min" cases lower.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81940





More information about the llvm-commits mailing list