[PATCH] D136080: [flang] Add -ffp-contract option processing

Andrzej Warzynski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 26 08:40:19 PDT 2022


awarzynski added a comment.

Thanks for all the updates, Tom! I have a few more suggestions.

>From the summary:

> implement these pragmas

Could you explain what pragmas you are referring to here? (i.e. Clang pragmas for C and C++ + link)

> gfortran uses "fast" by default

For our future self, could you add a link as well?



================
Comment at: clang/include/clang/Driver/Options.td:1925
   " | fast-honor-pragmas (fuses across statements unless diectated by pragmas)."
-  " Default is 'fast' for CUDA, 'fast-honor-pragmas' for HIP, and 'on' otherwise.">,
+  " Default is 'fast' for CUDA, 'fast-honor-pragmas' for HIP, 'off' for flang, and 'on' otherwise.">,
+  HelpText<"Form fused FP ops (e.g. FMAs)">,
----------------
I still think that we shouldn't be making references to Flang in Clang documentation. And this `DocBrief` is only used by Clang. Also, "flang" is problematic - what do you mean by "flang"?


================
Comment at: clang/lib/Driver/ToolChains/Flang.cpp:91-98
+    } else if (Val.equals("fast-honor-pragmas")) {
+      D.Diag(diag::warn_drv_unsupported_option_for_flang)
+          << Val << A->getOption().getName() << "fast";
+      FPContract = "fast";
+    } else if (Val.equals("on")) {
+      D.Diag(diag::warn_drv_unsupported_option_for_flang)
+          << Val << A->getOption().getName() << "off";
----------------
Some "unsupported" options are treated as errors and some are warnings. I think that for the sake of consistency it would be better to keep them all as errors. Also, why not use `Val` instead of e.g. "off"?


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

https://reviews.llvm.org/D136080



More information about the cfe-commits mailing list