[PATCH] D60516: [LTO] Add plumbing to save stats during LTO on Darwin.

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 19 04:45:14 PDT 2019

fhahn marked 2 inline comments as done.
fhahn added a comment.

In D60516#1470518 <https://reviews.llvm.org/D60516#1470518>, @tejohnson wrote:

> LGTM with a minor fix needed below.
> Darwin still uses the old LTO API, which is why the lto Config based handling in the new LTO API (LTO.h/LTO.cpp) are not being used on this path.

Yep, that is unfortunate. I'll create a PR to move it to the new API.

Comment at: llvm/lib/LTO/LTOCodeGenerator.cpp:101
+    "lto-stats-file",
+    cl::desc("With PGO, include profile count in optimization remarks"),
+    cl::Hidden);
tejohnson wrote:
> Wrong description for this option
Thanks, I'll fix it before I commit the change.

Comment at: llvm/lib/LTO/LTOCodeGenerator.cpp:601
   // If statistics were requested, print them out after codegen.
-  if (llvm::AreStatisticsEnabled())
+  if (llvm::AreStatisticsEnabled() && !StatsFile)
steven_wu wrote:
> You can simplify the logic a bit here.
> ```
> if (StatsFile)
> ...
> else if (llvm::AreStatisticsEnabled())
> ...
> ```
Thanks, I'll fix it before I commit the change.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list