<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/ProfileData/MemProfReader.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[MemProf] Write out raw profile bytes in little endian. (#150375)</title>
<updated>2025-07-31T04:44:20+00:00</updated>
<author>
<name>Snehasish Kumar</name>
<email>snehasishk@google.com</email>
</author>
<published>2025-07-31T04:44:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d1e43f6c1a28c3c64b3655be1fc1aff1029c48c8'/>
<id>d1e43f6c1a28c3c64b3655be1fc1aff1029c48c8</id>
<content type='text'>
Instead of writing out in native endian, write out the raw profile bytes
in little endian. Also update the MIB data in little endian. Also clean
up some lint and unused includes in rawprofile.cpp.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of writing out in native endian, write out the raw profile bytes
in little endian. Also update the MIB data in little endian. Also clean
up some lint and unused includes in rawprofile.cpp.</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[MemProf] Change histogram storage from uint64_t to uint16_t… (#151431)</title>
<updated>2025-07-31T01:28:53+00:00</updated>
<author>
<name>Snehasish Kumar</name>
<email>snehasishk@google.com</email>
</author>
<published>2025-07-31T01:28:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=08e40c12fa0c83652968f2f24c3ec76a062f4042'/>
<id>08e40c12fa0c83652968f2f24c3ec76a062f4042</id>
<content type='text'>
Reapply #147854 after fixes merged in #151398.

Change memory access histogram storage from uint64_t to uint16_t to
reduce profile size on disk. This change updates the raw profile format
to v5. Also add a histogram test in compiler-rt since we didn't have one
before. With this change the histogram memprof raw for the basic test
reduces from 75KB -&gt; 20KB.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reapply #147854 after fixes merged in #151398.

Change memory access histogram storage from uint64_t to uint16_t to
reduce profile size on disk. This change updates the raw profile format
to v5. Also add a histogram test in compiler-rt since we didn't have one
before. With this change the histogram memprof raw for the basic test
reduces from 75KB -&gt; 20KB.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[MemProf] Change histogram storage from uint64_t to uint16_t" (#151382)</title>
<updated>2025-07-30T19:36:45+00:00</updated>
<author>
<name>Snehasish Kumar</name>
<email>snehasishk@google.com</email>
</author>
<published>2025-07-30T19:36:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=24f9482abddbc24135d8e0143eb1bac499645648'/>
<id>24f9482abddbc24135d8e0143eb1bac499645648</id>
<content type='text'>
Reverts llvm/llvm-project#147854

Test failure when building with gcc.
https://lab.llvm.org/buildbot/#/builders/174/builds/21989</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#147854

Test failure when building with gcc.
https://lab.llvm.org/buildbot/#/builders/174/builds/21989</pre>
</div>
</content>
</entry>
<entry>
<title>[MemProf] Change histogram storage from uint64_t to uint16_t (#147854)</title>
<updated>2025-07-30T18:52:31+00:00</updated>
<author>
<name>Snehasish Kumar</name>
<email>snehasishk@google.com</email>
</author>
<published>2025-07-30T18:52:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1bf89e90a878e7e5844866d75b6c25933395435d'/>
<id>1bf89e90a878e7e5844866d75b6c25933395435d</id>
<content type='text'>
Change memory access histogram storage from uint64_t to uint16_t to
reduce profile size on disk. This change updates the raw profile format
to v5. Also add a histogram test in compiler-rt since we didn't have one
before. With this change the histogram memprof raw for the basic test
reduces from 75KB -&gt; 20KB.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change memory access histogram storage from uint64_t to uint16_t to
reduce profile size on disk. This change updates the raw profile format
to v5. Also add a histogram test in compiler-rt since we didn't have one
before. With this change the histogram memprof raw for the basic test
reduces from 75KB -&gt; 20KB.</pre>
</div>
</content>
</entry>
<entry>
<title>[MemProf] Add basic summary section support (#141805)</title>
<updated>2025-05-28T20:12:41+00:00</updated>
<author>
<name>Teresa Johnson</name>
<email>tejohnson@google.com</email>
</author>
<published>2025-05-28T20:12:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cc6f446d3865a5e3a6e50e16e670c307a479a110'/>
<id>cc6f446d3865a5e3a6e50e16e670c307a479a110</id>
<content type='text'>
This patch adds support for a basic MemProf summary section, which is
built along with the indexed MemProf profile (e.g. when reading the raw
or YAML profiles), and serialized through the indexed profile just after
the header.

Currently only 6 fields are written, specifically the number of contexts
(total, cold, hot), and the max context size (cold, warm, hot).

To support forwards and backwards compatibility for added fields in the
indexed profile, the number of fields serialized first. The code is
written to support forwards compatibility (reading newer profiles with
additional summary fields), and comments indicate how to implement
backwards compatibility (reading older profiles with fewer summary
fields) as needed.

Support is added to print the summary as YAML comments when displaying
both the raw and indexed profiles via `llvm-profdata show`. Because they
are YAML comments, the YAML reader ignores these (the summary is always
recomputed when building the indexed profile as described above).

This necessitated moving some options and a couple of interfaces out of
Analysis/MemoryProfileInfo.cpp and into the new
ProfileData/MemProfSummary.cpp file, as we need to classify context
hotness earlier and also compute context ids to build the summary from
older indexed profiles.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds support for a basic MemProf summary section, which is
built along with the indexed MemProf profile (e.g. when reading the raw
or YAML profiles), and serialized through the indexed profile just after
the header.

Currently only 6 fields are written, specifically the number of contexts
(total, cold, hot), and the max context size (cold, warm, hot).

To support forwards and backwards compatibility for added fields in the
indexed profile, the number of fields serialized first. The code is
written to support forwards compatibility (reading newer profiles with
additional summary fields), and comments indicate how to implement
backwards compatibility (reading older profiles with fewer summary
fields) as needed.

Support is added to print the summary as YAML comments when displaying
both the raw and indexed profiles via `llvm-profdata show`. Because they
are YAML comments, the YAML reader ignores these (the summary is always
recomputed when building the indexed profile as described above).

This necessitated moving some options and a couple of interfaces out of
Analysis/MemoryProfileInfo.cpp and into the new
ProfileData/MemProfSummary.cpp file, as we need to classify context
hotness earlier and also compute context ids to build the summary from
older indexed profiles.</pre>
</div>
</content>
</entry>
<entry>
<title>Re-apply "[StaticDataLayout][PGO]Implement reader and writer change for data access profiles" (#141275)</title>
<updated>2025-05-24T17:33:50+00:00</updated>
<author>
<name>Mingming Liu</name>
<email>mingmingl@google.com</email>
</author>
<published>2025-05-24T17:33:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6bbaef1a95989afadc2c298018ac531591e4f159'/>
<id>6bbaef1a95989afadc2c298018ac531591e4f159</id>
<content type='text'>
Re-apply https://github.com/llvm/llvm-project/pull/139997 after fixing the use-of-uninitialized-memory error
(https://lab.llvm.org/buildbot/#/builders/94/builds/7373).

Tested: The error is reproduced with
https://github.com/llvm/llvm-zorg/blob/main/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_msan.sh
without the fix, and test pass with the fix.


**Original commit message:**

https://github.com/llvm/llvm-project/pull/138170 introduces classes to
operate on data access profiles. This change supports the read and write
of `DataAccessProfData` in indexed format of MemProf (v4) as well as its
the text (yaml) format.

For indexed format:
* InstrProfWriter owns (by `std::unique_ptr&lt;DataAccessProfData&gt;`) the
data access profiles, and gives a non-owned copy when it calls
`writeMemProf`.
* MemProf v4 header has a new `uint64_t` to record the byte offset of
data access profiles. This `uint64_t` field is zero if data access
profile is not set (nullptr).
* MemProfReader reads the offset from v4 header and de-serializes
in-memory bytes into class `DataAccessProfData`.

For textual format:
* MemProfYAML.h adds the mapping for DAP class, and make DAP optional
for both read and write.

099a0fa (by @snehasish) introduces v4 which contains CalleeGuids in
CallSiteInfo, and this change changes the v4 format in place with data
access profiles. The current plan is to bump the version and enable v4
profiles with both features, assuming waiting for this change won't
delay the callsite change too long.

---------

Co-authored-by: Kazu Hirata &lt;kazu@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Re-apply https://github.com/llvm/llvm-project/pull/139997 after fixing the use-of-uninitialized-memory error
(https://lab.llvm.org/buildbot/#/builders/94/builds/7373).

Tested: The error is reproduced with
https://github.com/llvm/llvm-zorg/blob/main/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_msan.sh
without the fix, and test pass with the fix.


**Original commit message:**

https://github.com/llvm/llvm-project/pull/138170 introduces classes to
operate on data access profiles. This change supports the read and write
of `DataAccessProfData` in indexed format of MemProf (v4) as well as its
the text (yaml) format.

For indexed format:
* InstrProfWriter owns (by `std::unique_ptr&lt;DataAccessProfData&gt;`) the
data access profiles, and gives a non-owned copy when it calls
`writeMemProf`.
* MemProf v4 header has a new `uint64_t` to record the byte offset of
data access profiles. This `uint64_t` field is zero if data access
profile is not set (nullptr).
* MemProfReader reads the offset from v4 header and de-serializes
in-memory bytes into class `DataAccessProfData`.

For textual format:
* MemProfYAML.h adds the mapping for DAP class, and make DAP optional
for both read and write.

099a0fa (by @snehasish) introduces v4 which contains CalleeGuids in
CallSiteInfo, and this change changes the v4 format in place with data
access profiles. The current plan is to bump the version and enable v4
profiles with both features, assuming waiting for this change won't
delay the callsite change too long.

---------

Co-authored-by: Kazu Hirata &lt;kazu@google.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[StaticDataLayout][PGO]Implement reader and writer change for data access profiles" (#141157)</title>
<updated>2025-05-22T23:14:36+00:00</updated>
<author>
<name>Mingming Liu</name>
<email>mingmingl@google.com</email>
</author>
<published>2025-05-22T23:14:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d0acddbdd615f1503e88903570ee7484bd217615'/>
<id>d0acddbdd615f1503e88903570ee7484bd217615</id>
<content type='text'>
Reverts llvm/llvm-project#139997

Sanitizer failures
(https://lab.llvm.org/buildbot/#/builders/94/builds/7373)

Will fix forward later.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#139997

Sanitizer failures
(https://lab.llvm.org/buildbot/#/builders/94/builds/7373)

Will fix forward later.</pre>
</div>
</content>
</entry>
<entry>
<title>[StaticDataLayout][PGO]Implement reader and writer change for data access profiles (#139997)</title>
<updated>2025-05-22T19:51:04+00:00</updated>
<author>
<name>Mingming Liu</name>
<email>mingmingl@google.com</email>
</author>
<published>2025-05-22T19:51:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=45f6036533bd30966f5e815568b792a7e293a0e8'/>
<id>45f6036533bd30966f5e815568b792a7e293a0e8</id>
<content type='text'>
https://github.com/llvm/llvm-project/pull/138170 introduces classes to
operate on data access profiles. This change supports the read and write
of `DataAccessProfData` in indexed format of MemProf (v4) as well as its
the text (yaml) format.

For indexed format:
* InstrProfWriter owns (by `std::unique_ptr&lt;DataAccessProfData&gt;`) the
data access profiles, and gives a non-owned copy when it calls
`writeMemProf`.
* MemProf v4 header has a new `uint64_t` to record the byte offset of
data access profiles. This `uint64_t` field is zero if data access
profile is not set (nullptr).
* MemProfReader reads the offset from v4 header and de-serializes
in-memory bytes into class `DataAccessProfData`.

For textual format:
* MemProfYAML.h adds the mapping for DAP class, and make DAP optional
for both read and write.

099a0fa (by @snehasish) introduces v4 which contains CalleeGuids in
CallSiteInfo, and this change changes the v4 format in place with data
access profiles. The current plan is to bump the version and enable v4
profiles with both features, assuming waiting for this change won't
delay the callsite change too long.

---------

Co-authored-by: Kazu Hirata &lt;kazu@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/pull/138170 introduces classes to
operate on data access profiles. This change supports the read and write
of `DataAccessProfData` in indexed format of MemProf (v4) as well as its
the text (yaml) format.

For indexed format:
* InstrProfWriter owns (by `std::unique_ptr&lt;DataAccessProfData&gt;`) the
data access profiles, and gives a non-owned copy when it calls
`writeMemProf`.
* MemProf v4 header has a new `uint64_t` to record the byte offset of
data access profiles. This `uint64_t` field is zero if data access
profile is not set (nullptr).
* MemProfReader reads the offset from v4 header and de-serializes
in-memory bytes into class `DataAccessProfData`.

For textual format:
* MemProfYAML.h adds the mapping for DAP class, and make DAP optional
for both read and write.

099a0fa (by @snehasish) introduces v4 which contains CalleeGuids in
CallSiteInfo, and this change changes the v4 format in place with data
access profiles. The current plan is to bump the version and enable v4
profiles with both features, assuming waiting for this change won't
delay the callsite change too long.

---------

Co-authored-by: Kazu Hirata &lt;kazu@google.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][MemProf] Move getGUID out of IndexedMemProfRecord (#140502)</title>
<updated>2025-05-19T23:18:57+00:00</updated>
<author>
<name>Snehasish Kumar</name>
<email>snehasishk@google.com</email>
</author>
<published>2025-05-19T23:18:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ad3c1d2091d7f793101d7acbb06f3449ab01a310'/>
<id>ad3c1d2091d7f793101d7acbb06f3449ab01a310</id>
<content type='text'>
Part of a larger refactoring with the following goals
1. Reduce the size of MemProf.h 
2. Avoid including ModuleSummaryIndex just for a couple of types</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Part of a larger refactoring with the following goals
1. Reduce the size of MemProf.h 
2. Avoid including ModuleSummaryIndex just for a couple of types</pre>
</div>
</content>
</entry>
<entry>
<title>[memprof] Avoid repeated hash lookups (NFC) (#136268)</title>
<updated>2025-04-18T08:07:05+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-04-18T08:07:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5db95fd6ca8cae62c6ab6acf17b00c3417d2018d'/>
<id>5db95fd6ca8cae62c6ab6acf17b00c3417d2018d</id>
<content type='text'>
Note that we don't have to worry about CallstackProfileData[Id]
default-constructing the value side of a new map entry.  If that
happens, AccessHistogramSize &gt; 0 wouldn't be true, and the new map
entry gets deleted right away.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Note that we don't have to worry about CallstackProfileData[Id]
default-constructing the value side of a new map entry.  If that
happens, AccessHistogramSize &gt; 0 wouldn't be true, and the new map
entry gets deleted right away.</pre>
</div>
</content>
</entry>
</feed>
