[PATCH] D155452: [Flang] Add support for fsave-optimization-record

Kiran Chandramohan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 17 06:07:30 PDT 2023


kiranchandramohan added a comment.

Couple of quick comments.

You probably need another frontend-forwarding test to check `fsave-optimization-record=<file_name>`.



================
Comment at: clang/lib/Driver/ToolChains/Flang.cpp:392-395
+static void renderRemarksOptions(const ArgList &Args, ArgStringList &CmdArgs,
+                                 const llvm::Triple &Triple,
+                                 const InputInfo &Input,
+                                 const InputInfo &Output, const JobAction &JA) {
----------------
JA and Triple do not seem to be used.

If the functionalities are similar, you could move the `renderRemarksOptions` from Clang to a file in `llvm/Frontend/` and then use that in Flang.


================
Comment at: flang/test/Driver/fsave-optimization-record.f90:8-11
+! RUN: %flang -fsave-optimization-record=yaml %s
+! RUN: %flang -fsave-optimization-record -S %s
+! RUN: %flang -fsave-optimization-record -S -emit-llvm %s
+! RUN: %flang -fsave-optimization-record -c %s
----------------
Check for the existence of the optimization report in all these cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155452



More information about the cfe-commits mailing list