[PATCH] D92436: [Time-report] Add a flag -ftime-report={per-pass,per-pass-run} to control the pass timing aggregation

Yuanfang Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 1 16:23:02 PST 2020


ychen created this revision.
ychen added reviewers: efriedma, philip.pfaffe, chandlerc.
Herald added subscribers: llvm-commits, cfe-commits, dexonsmith, dang, hiraditya, mgorny.
Herald added projects: clang, LLVM.
ychen requested review of this revision.

Currently, -ftime-report + new pass manager emits one line of report for each 
pass run. This potentially causes huge output text especially with regular LTO 
or large single file (Obeserved in private tests and was reported in D51276 <https://reviews.llvm.org/D51276>).
The behaviour of -ftime-report + legacy pass manager is 
emitting one line of report for each pass object which has relatively reasonable
text output size. This patch adds a flag `-ftime-report=` to control time report
aggregation for new pass manager.

The flag is for new pass manager only. Using it with legacy pass manager gives 
an error. It is a driver and cc1 flag. `per-pass` is the new default so 
`-ftime-report` is aliased to `-ftime-report=per-pass`. Before this patch, 
functionality-wise `-ftime-report` is aliased to `-ftime-report=per-pass-run`.

- Adds an boolean variable TimePassesHandler::PerRun to control per-pass vs per-pass-run.
- Adds a new clang CodeGen flag CodeGenOptions::TimePassesPerRun to work with the existing CodeGenOptions::TimePasses.
- Remove FrontendOptions::ShowTimers, its uses are replaced by the existing CodeGenOptions::TimePasses.
- Remove FrontendTimesIsEnabled (It was introduced in D45619 <https://reviews.llvm.org/D45619> which was largely reverted.)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92436

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/Options.td
  clang/include/clang/Frontend/FrontendOptions.h
  clang/include/clang/Frontend/Utils.h
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/CodeGen/CodeGenAction.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/CMakeLists.txt
  clang/lib/Frontend/CompilerInstance.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/lib/Frontend/FrontendTiming.cpp
  clang/test/Driver/time-report.c
  clang/test/Misc/time-passes.c
  llvm/include/llvm/IR/PassTimingInfo.h
  llvm/include/llvm/Pass.h
  llvm/lib/IR/PassTimingInfo.cpp
  llvm/test/Other/time-passes.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92436.308811.patch
Type: text/x-patch
Size: 24351 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201202/c1ff8fec/attachment-0001.bin>


More information about the cfe-commits mailing list