https://reviews.llvm.org/D50923 enabled the IR printing support for the new pass manager, but only for the case when opt tool is used as a driver. This patch is to enable the IR printing when clang is used as a driver.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
@fedor.sergeev @yamauchi I saw your discussions over llvm-dev mailing list regarding IR printing with the new pass manager, and though this might be the reason why IR printing is not supported under new PM with clang. I would appreciate if you can take a look.
Yep, you are right, standard instrumentation needs to be passed into PassBuilder for printing and time-passes to work.
Main changes are fine, just a small note on the test below.
clang/test/Misc/printer.c | ||
---|---|---|
1 ↗ | (On Diff #214233) | Can this test avoid using -O2 and check for some generic always-present pass like ModuleVerifier? |
@fedor.sergeev Sorry for the late reply. I missed your comment.
I found that with the new pass manager module verifier is not scheduled by default, and AlwaysInlinerPass is the only one scheduled if I provide no -O option. I removed -O2 from the test command and replaced ForceFunctionAttrPass to AlwaysInlinerPass.
Thanks!