================
@@ -1224,9 +1272,11 @@ Expr<T> RewriteSpecificMINorMAX(
   
intrinsic.characteristics.value().functionResult.value().SetType(*resultType);
   auto insertConversion{[&](const auto &x) -> Expr<T> {
     using TR = ResultType<decltype(x)>;
+    const int kind{x.kind()};
     FunctionRef<TR> maxRef{
-        ProcedureDesignator{funcRef.proc()}, ActualArguments{args}};
-    return Fold(context, ConvertToType<T>(AsCategoryExpr(std::move(maxRef))));
+        kind, ProcedureDesignator{funcRef.proc()}, ActualArguments{args}};
+    return Fold(
+        context, ConvertToType<T>(kind, AsCategoryExpr(std::move(maxRef))));
----------------
tblah wrote:

I think this convert should use the kind from the `funcRef` not from the 
arguments. Codex gave me two cases where these don't necessarily match: 
`amax0(1_8,2_8)`, `max1(1.0_8,2.0_8)` (and from my reading of the standard, the 
same applies for `amin0`, `min1`)

https://github.com/llvm/llvm-project/pull/216960
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to