This allows generating CG profile using legacy pass manager
Diff Detail
Event Timeline
FYI what I heard at the dev meeting yesterday is that we are very close to being able to switch to the new PM by default, after which the legacy PM will be removed (I'm sure not immediately, but the goal is to get down to one PM soon). Before you do a lot of work backporting some of the new passes like this, is switching to the new PM an option for you?
Thanks for looking at it, Teresa!
Here is a llvm-dev post, suggesting to use new PM by default:
http://lists.llvm.org/pipermail/llvm-dev/2017-October/118280.html
As you may have noticed it was two years ago and new PM is still "brand new" :)
Also, AFAIK, codegen passes still use old PM, so I guess it will be around for quite a while.
Until new PM is adopted as default by LLVM community, switching to it is not an option for us, unfortunately.
And I need just this pass (it does pretty good job optimizing PGO instrumented images) and don't have plans to port anything else.
Ok, still suggest trying to move to new PM proactively to make sure it works for you, but it's fine with me to back port this. A few comments below.
include/llvm/LinkAllPasses.h | ||
---|---|---|
87 ↗ | (On Diff #226107) | Formatting off |
lib/Transforms/IPO/PassManagerBuilder.cpp | ||
781 ↗ | (On Diff #226107) | I notice that in the new PM this is added after the OptimizerLast EPs are added. Not sure if that is intentional - should the new and old PMs be consistent here? |
lib/Transforms/Instrumentation/CGProfile.cpp | ||
30 ↗ | (On Diff #226107) | Nit: Suggest moving this declaration to before Symtab which puts it in the same relative order as before and should avoid a spurious diff here. |
test/Other/opt-O2-pipeline.ll | ||
290 ↗ | (On Diff #226107) | Will this unnamed pass issue be fixed by D69315? |
This was originally not added to the legacy pass manager because it leaks memory under it due to fundamental issues with the old pass manager. See https://reviews.llvm.org/D48105#1140299 .
This was originally not added to the legacy pass manager because it leaks memory under it due to fundamental issues with the old pass manager. See https://reviews.llvm.org/D48105#1140299 .
@Bigcheese @chandlerc Can you please elaborate? I've run llvm, clang and lld test suites with lsan and everything seems good. What's the problem exactly?
test/Other/opt-O2-pipeline.ll | ||
---|---|---|
290 ↗ | (On Diff #226107) | Yes |
Addressed comments.
I've run test cases of llvm/clang built with ASAN and LSAN without problems.
If problem details can't be recalled at the moment, I suggest landing this patch and reverting it if problem arises
Hi, I just noticed now that here was a patch porting CGProfile Pass to legacy PM. I created a similar one and landed it https://reviews.llvm.org/D83013.