[llvm] [llvm-profdata] Enabled functionality to write split-layout profile (PR #101795)
William Junda Huang via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 10 01:56:49 PDT 2024
================
@@ -223,6 +223,11 @@ static bool ParseLine(const StringRef &Input, LineType &LineTy, uint32_t &Depth,
if (Input[Depth] == '!') {
LineTy = LineType::Metadata;
+ // This metadata is only for manual inspection only. We already created a
+ // FunctionSamples and put it in the profile map, so there is no point
+ // to skip profiles even they have no use for ThinLTO.
+ if (Input == StringRef(" !Flat"))
----------------
huangjd wrote:
Text and Extbinary mode was already not perfectly compatible. There are already various types of info that will be lost when converting Extbinary to Text, for example Profile Symbol List, flags such as PartialProfile, ProfileIsFS etc. Furthermore, the sample profile writer splits flat profiles from non-flat profiles at runtime, and the reader ignores the flag if used by llvm-profdata (instead of used by thinLTO), so the flag is a no-op in this sense, and the round trip output will be identical, unless the user intentionally marked a non-flat function as flat, which doesn't make sense anyways (profile reader could emit a warning in this case but it is also pointless, because 1. in llvm-profdata the writer will correct this, 2. in thinLTO the flat section is skipped intentionally so we don't even know there's non-flat function inside 3. in other compilation mode we read all functions with matching names regardless they are flat or not.)
https://github.com/llvm/llvm-project/pull/101795
More information about the llvm-commits
mailing list