This allows optimization passes to make use of detailed profile summary. Once this is in and the optimization passes are made to use this, the "MaxFunctionCount" flag will be removed as the profile summary supersedes that.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Thanks! Some inline comments --
lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
399 ↗ | (On Diff #51088) | getModule().getContext() -> VMContext? |
401 ↗ | (On Diff #51088) | I don't think we need this assert. A lot of code depends on MDTuple::get just working -- it's fine to crash if it doesn't. |
test/Profile/profile-summary.c | ||
5 ↗ | (On Diff #51088) | ISTM that a lot of the lines in this file do not contribute additional coverage of the changes introduced by your patch. We already have tests which show that the summary code works (general.proftext). I think we just need 1 empty function with 1 counter in this file. We don't need to check that the entire detailed summary appears in the metadata, just one cutoff entry should suffice. |
lib/CodeGen/CodeGenModule.cpp | ||
---|---|---|
398 ↗ | (On Diff #51088) | This line will be removed later once the client code has been updated right? |
399 ↗ | (On Diff #51088) | or Module &M = getModule(); |
test/Profile/profile-summary.c | ||
5 ↗ | (On Diff #51088) | That test is actually not as good for testing summary computation as this one. Perhaps we can simplify this test and move this test (removing the clang dump part) into llvm-profdata dir. |
test/Profile/profile-summary.c | ||
---|---|---|
5 ↗ | (On Diff #51088) | Makes sense to me. |
Since test case tests this change - that profile summary is attached to the module - I think it is sufficient. David and Vedant, does this sound reasonable?
This lgtm.
IMO we'd get the same coverage if the C file contained void foo() {}, but that's just a nit :). It'd be good to follow up with David about what he thinks is lacking in general.proftext, but that's for a later commit.