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.
Differential D34728
[ThinkLTO] Invoke build(Thin)?LTOPreLinkDefaultPipeline. timshen on Jun 27 2017, 5:08 PM. Authored by
Details 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 TimelineComment 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.
Comment Actions Added -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. Comment Actions Already said LGTM, please go ahead and submit. If tehre are further requsets, we can always amke follow-up changes. |