Previously it doesn't actually invoke the designated new PM builder
functions.
This patch moves NameAnonGlobalPass out from PassBuilder, as Chandler points out that PassBuilder is used for non-O0 builds, and for optimizations only.
Paths
| Differential D34728
[ThinkLTO] Invoke build(Thin)?LTOPreLinkDefaultPipeline. ClosedPublic Authored by timshen on Jun 27 2017, 5:08 PM.
Details Summary Previously it doesn't actually invoke the designated new PM builder This patch moves NameAnonGlobalPass out from PassBuilder, as Chandler points out that PassBuilder is used for non-O0 builds, and for optimizations only.
Diff Detail
Event TimelineHerald added subscribers: hiraditya, eraman, inglorion and 2 others. · View Herald TranscriptJun 27 2017, 5:08 PM Comment Actions A question I have is that I don't know how to test this. Ideally we want -debug-pass-manager from opt, but that flag is not part of the LLVM libraries.
Comment Actions
How about add a clang test that builds with "-mllvm -debug-pass=Structure" and -flto=thin, and check for the passes that are now expected to be added with this patch.
timshen marked 5 inline comments as done. Comment ActionsAdded -fexperimental-new-pass-manager=off/on/debug for printing debug information. Added a Clang test. Do tell if you want me to split this patch. I didn't, becuase then I don't have to write a test for each of them. :)
Comment Actions
I think they should be split into two patches, one for the option change and one for the thinLTO pipeline fixes. You could just put the new lto-newpm-pipeline.c test in with the option changes patch and commit it right after the thinlto pipeline fixes (or do it first and modify that test to add the thinlto passes when the pipeline fix goes in). LGTM, but please wait to see if Chandler has any more comments.
Comment Actions Splitted into two patches. I'll commit this one (ThinLTO change) without the test first, then commit the flag change with the Clang ThinLTO pipeline test. This revision is now accepted and ready to land.Jun 28 2017, 5:54 PM Closed by commit rL306756: [ThinkLTO] Invoke build(Thin)?LTOPreLinkDefaultPipeline. (authored by timshen). · Explain WhyJun 29 2017, 4:08 PM This revision was automatically updated to reflect the committed changes. Comment Actions Already said LGTM, please go ahead and submit. If tehre are further requsets, we can always amke follow-up changes.
Revision Contents
Diff 104533 clang/include/clang/Driver/Options.td
clang/include/clang/Frontend/CodeGenOptions.h
clang/include/clang/Frontend/CodeGenOptions.def
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/lto-newpm-pipeline.c
llvm/include/llvm/Option/ArgList.h
llvm/lib/Option/ArgList.cpp
llvm/lib/Passes/PassBuilder.cpp
llvm/test/Other/new-pm-thinlto-defaults.ll
|
Document