To be more clear and definitive, I'm renaming ProfileIsCSFlat back to ProfileIsCS which stands for full context-sensitive flat profiles. ProfileIsCSNested is now renamed to ProfileIsPreInlined and is extended to be applicable for CS flat profiles too. More specifically, ProfileIsPreInlined is for any kind of profiles (flat or nested) that contain 'ShouldBeInlined' contexts. The flag is encoded in the profile summary section for extbinary profiles and is computed on-the-fly for text profiles.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/tools/llvm-profgen/CSPreInliner.cpp | ||
---|---|---|
200 | I think we should set this in CSPreInliner::run()? In theory even if preinliner did nothing to the input profile, as long as we run it, the profile should be considered preinlined. That also avoids setting it in the loop, for each function. |
llvm/tools/llvm-profgen/CSPreInliner.cpp | ||
---|---|---|
200 | Sounds good. |
llvm/tools/llvm-profgen/CSPreInliner.cpp | ||
---|---|---|
200 | For the case I mentioned, how do we mark a profile as preinlined for text profile though, if no context actually has the preinline bit, but preinliner was run? Admittedly this is a very corner case.. |
llvm/tools/llvm-profgen/CSPreInliner.cpp | ||
---|---|---|
200 | We don't have a way to tell if a text profile is preinlined for that case. But on the other hand, such a text profile would not be considered as preinlined with the previous version. The "shouldInline" flag per context is the only way to tell if a text profile is preinlined or not. The new iteration creates a discrepancy between text and extbin profile when there isn't any context with "shouldInline" flag. Such extbin profile will not lead to any inlining in the compiler, but the text counterpart would. I think the behavior of the extbin profile is what we want. Unfortunately that cannot be achieved with text profile. |
llvm/tools/llvm-profgen/CSPreInliner.cpp | ||
---|---|---|
200 | Ok, perhaps we can live with that discrepancy, given it's a corner case and text profile isn't used much. |
I think we should set this in CSPreInliner::run()? In theory even if preinliner did nothing to the input profile, as long as we run it, the profile should be considered preinlined.
That also avoids setting it in the loop, for each function.