<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/Instrumentation/MemProfUse.cpp, branch users/ojhunt/ptrauth-additions</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>[StaticDataLayout] Factor out a helper function for section prefix eligibility and use it in both optimizer and codegen (#162348)</title>
<updated>2025-10-13T18:26:16+00:00</updated>
<author>
<name>Mingming Liu</name>
<email>mingmingl@google.com</email>
</author>
<published>2025-10-13T18:26:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e313bc834ea8c511e1665c738a33cb2eee4f94d8'/>
<id>e313bc834ea8c511e1665c738a33cb2eee4f94d8</id>
<content type='text'>
This change introduces new helper functions to check if a global
variable is eligible for section prefix annotation.

This shared logic is used by both MemProfUse and StaticDataSplitter to
avoid annotating ineligible variables.

This is the 2nd patch as a split of
https://github.com/llvm/llvm-project/pull/155337</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change introduces new helper functions to check if a global
variable is eligible for section prefix annotation.

This shared logic is used by both MemProfUse and StaticDataSplitter to
avoid annotating ineligible variables.

This is the 2nd patch as a split of
https://github.com/llvm/llvm-project/pull/155337</pre>
</div>
</content>
</entry>
<entry>
<title>[StaticDataLayout][MemProf] Record whether the IR is compiled with data access profiles by module flag.  (#162333)</title>
<updated>2025-10-13T17:29:23+00:00</updated>
<author>
<name>Mingming Liu</name>
<email>mingmingl@google.com</email>
</author>
<published>2025-10-13T17:29:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a6fdbcbb2ccca07af2154509801fc6b6d27542a3'/>
<id>a6fdbcbb2ccca07af2154509801fc6b6d27542a3</id>
<content type='text'>
The codegen pass in the pipeline can read the module flag to tell
whether the IR is compiled with data access profile, to support two use
cases when `memprof-annotate-static-data-prefix=true` is enabled

1. The binary is compiled with data access profiles. 
- The module flag will have value 1, and codegen pass should regard an
empty section prefix as 'unknown' and conservatively not placing the
data into `.unlikely` data sections.

2. The binary is compiled without data access profiles (e.g., during
incremental rollout, etc)
- The module flag will have value 0, and codegen pass can override an
empty section prefix based on PGO counters.

https://github.com/llvm/llvm-project/pull/155337 shows the motivating
use case in function `StaticDataProfileInfo::getConstantSectionPrefix`
in `llvm/lib/Analysis/StaticDataProfileInfo.cpp`

This is the 1st patch as a split of
https://github.com/llvm/llvm-project/pull/155337</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The codegen pass in the pipeline can read the module flag to tell
whether the IR is compiled with data access profile, to support two use
cases when `memprof-annotate-static-data-prefix=true` is enabled

1. The binary is compiled with data access profiles. 
- The module flag will have value 1, and codegen pass should regard an
empty section prefix as 'unknown' and conservatively not placing the
data into `.unlikely` data sections.

2. The binary is compiled without data access profiles (e.g., during
incremental rollout, etc)
- The module flag will have value 0, and codegen pass can override an
empty section prefix based on PGO counters.

https://github.com/llvm/llvm-project/pull/155337 shows the motivating
use case in function `StaticDataProfileInfo::getConstantSectionPrefix`
in `llvm/lib/Analysis/StaticDataProfileInfo.cpp`

This is the 1st patch as a split of
https://github.com/llvm/llvm-project/pull/155337</pre>
</div>
</content>
</entry>
<entry>
<title>Re-apply "[NFCI][Globals] In GlobalObjects::setSectionPrefix, do conditional update if existing prefix is not equivalent to the new one. Returns whether prefix changed." (#159161)</title>
<updated>2025-09-16T20:33:29+00:00</updated>
<author>
<name>Mingming Liu</name>
<email>mingmingl@google.com</email>
</author>
<published>2025-09-16T20:33:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8b3c91c4fb1b8efaccb71894684e4fb16b0e8945'/>
<id>8b3c91c4fb1b8efaccb71894684e4fb16b0e8945</id>
<content type='text'>
This is a reland of https://github.com/llvm/llvm-project/pull/158460

Test failures are gone once I undo the changes in codegenprepare.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a reland of https://github.com/llvm/llvm-project/pull/158460

Test failures are gone once I undo the changes in codegenprepare.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[NFCI][Globals] In GlobalObjects::setSectionPrefix, do conditional update if existing prefix is not equivalent to the new one. Returns whether prefix changed." (#159159)</title>
<updated>2025-09-16T19:51:54+00:00</updated>
<author>
<name>Mingming Liu</name>
<email>mingmingl@google.com</email>
</author>
<published>2025-09-16T19:51:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9277bcd1ab83fbfecfaaa5e15f3821808c5a6e38'/>
<id>9277bcd1ab83fbfecfaaa5e15f3821808c5a6e38</id>
<content type='text'>
Reverts llvm/llvm-project#158460 due to buildbot failures</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#158460 due to buildbot failures</pre>
</div>
</content>
</entry>
<entry>
<title>[NFCI][Globals] In GlobalObjects::setSectionPrefix, do conditional update if existing prefix is not equivalent to the new one. Returns whether prefix changed. (#158460)</title>
<updated>2025-09-16T19:01:21+00:00</updated>
<author>
<name>Mingming Liu</name>
<email>mingmingl@google.com</email>
</author>
<published>2025-09-16T19:01:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=027bccc4692923d0f1ba3d4d970071f747c2255c'/>
<id>027bccc4692923d0f1ba3d4d970071f747c2255c</id>
<content type='text'>
Before this change, `setSectionPrefix` overwrites existing section
prefix with new one unconditionally.

After this change, `setSectionPrefix` checks for equivalences, updates
conditionally and returns whether an update happens.

Update the existing callers to make use of the return value. [PR
155337](https://github.com/llvm/llvm-project/pull/155337/files#diff-cc0c67ac89807f4453f0cfea9164944a4650cd6873a468a0f907e7158818eae9)
is a motivating use case whether the 'update' semantic is needed.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this change, `setSectionPrefix` overwrites existing section
prefix with new one unconditionally.

After this change, `setSectionPrefix` checks for equivalences, updates
conditionally and returns whether an update happens.

Update the existing callers to make use of the return value. [PR
155337](https://github.com/llvm/llvm-project/pull/155337/files#diff-cc0c67ac89807f4453f0cfea9164944a4650cd6873a468a0f907e7158818eae9)
is a motivating use case whether the 'update' semantic is needed.</pre>
</div>
</content>
</entry>
<entry>
<title>[MemProf] Extend MemProfUse pass to make use of data access profiles to partition data (#151238)</title>
<updated>2025-08-28T03:43:37+00:00</updated>
<author>
<name>Mingming Liu</name>
<email>mingmingl@google.com</email>
</author>
<published>2025-08-28T03:43:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c93b3a345406f0ee6cef28b8b85a94d734b40fb0'/>
<id>c93b3a345406f0ee6cef28b8b85a94d734b40fb0</id>
<content type='text'>
https://github.com/llvm/llvm-project/commit/f3f28323adbb9d01372d81b4c78ed94683e58757
introduces the data access profile format as a payload inside
[memprof](https://llvm.org/docs/InstrProfileFormat.html#memprof-profile-data),
and the MemProfUse pass reads the memprof payload.

This change extends the MemProfUse pass to read the data access profiles
to annotate global variables' section prefix.
1. If there are samples for a global variable, it's annotated as hot.
2. If a global variable is seen in the profiled binary file but doesn't
have access samples, it's annotated as unlikely.

Introduce an option `annotate-static-data-prefix` to flag-gate the
global-variable annotation path, and make it false by default.
https://github.com/llvm/llvm-project/pull/155337 is the (WIP) draft
change to "reconcile" two sources of hotness.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/commit/f3f28323adbb9d01372d81b4c78ed94683e58757
introduces the data access profile format as a payload inside
[memprof](https://llvm.org/docs/InstrProfileFormat.html#memprof-profile-data),
and the MemProfUse pass reads the memprof payload.

This change extends the MemProfUse pass to read the data access profiles
to annotate global variables' section prefix.
1. If there are samples for a global variable, it's annotated as hot.
2. If a global variable is seen in the profiled binary file but doesn't
have access samples, it's annotated as unlikely.

Introduce an option `annotate-static-data-prefix` to flag-gate the
global-variable annotation path, and make it false by default.
https://github.com/llvm/llvm-project/pull/155337 is the (WIP) draft
change to "reconcile" two sources of hotness.</pre>
</div>
</content>
</entry>
<entry>
<title>[memprof] Simplify control flow in readMemProf (NFC) (#149764)</title>
<updated>2025-07-21T16:11:08+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-07-21T16:11:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a270fdf3fe58dff7093c8bc1c7ffbd03c0268d66'/>
<id>a270fdf3fe58dff7093c8bc1c7ffbd03c0268d66</id>
<content type='text'>
Now that readMemProf calls two helper functions handleAllocSite and
handleCallSite, we can simplify the control flow.  We don't need to
use "continue" anymore.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that readMemProf calls two helper functions handleAllocSite and
handleCallSite, we can simplify the control flow.  We don't need to
use "continue" anymore.</pre>
</div>
</content>
</entry>
<entry>
<title>[memprof] Introduce handleCallSite (NFC) (#149724)</title>
<updated>2025-07-21T03:42:17+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-07-21T03:42:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=507ff29c9bdb43e78cf0e5aac82972ed3b2907b7'/>
<id>507ff29c9bdb43e78cf0e5aac82972ed3b2907b7</id>
<content type='text'>
Continuing the effort to refactor readMemProf, this patch introduces
handlCallSite to handle, well, call sites.

Moving the code requires taking CallSiteEntry and CallSiteEntryHash
out of readMemProf.

We could simplify some code, but I'm keeping this patch very simple to
facilitate the review process.  For example, we could simplify the
control flow near the end of readMemProf, but we can address that
later.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Continuing the effort to refactor readMemProf, this patch introduces
handlCallSite to handle, well, call sites.

Moving the code requires taking CallSiteEntry and CallSiteEntryHash
out of readMemProf.

We could simplify some code, but I'm keeping this patch very simple to
facilitate the review process.  For example, we could simplify the
control flow near the end of readMemProf, but we can address that
later.</pre>
</div>
</content>
</entry>
<entry>
<title>[memprof] Refactor readMemProf (NFC) (#149663)</title>
<updated>2025-07-20T15:27:24+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-07-20T15:27:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=04f2114ab293570604c7178aaf2e4585b61ae8aa'/>
<id>04f2114ab293570604c7178aaf2e4585b61ae8aa</id>
<content type='text'>
This patch creates a helper function named handleAllocSite to handle
the allocation site.  It makes readMemProf a little bit shorter.

I'm planning to move the code to handle call sites in a subsequent
patch.  Doing so in this patch would make this patch a lot longer
because we need to move other things like CallSiteEntry and
CallSiteEntryHash.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch creates a helper function named handleAllocSite to handle
the allocation site.  It makes readMemProf a little bit shorter.

I'm planning to move the code to handle call sites in a subsequent
patch.  Doing so in this patch would make this patch a lot longer
because we need to move other things like CallSiteEntry and
CallSiteEntryHash.</pre>
</div>
</content>
</entry>
<entry>
<title>[MemProf] Split MemProfiler into Instrumentation and Use. (#142811)</title>
<updated>2025-06-05T14:36:50+00:00</updated>
<author>
<name>Snehasish Kumar</name>
<email>snehasishk@google.com</email>
</author>
<published>2025-06-05T14:36:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=16c7b3c9f51773948248b4cfbcf2b9f0e0dc49fa'/>
<id>16c7b3c9f51773948248b4cfbcf2b9f0e0dc49fa</id>
<content type='text'>
Most of the recent development on the MemProfiler has been on the Use part. The instrumentation has been quite stable for a while. As the complexity of the use grows (with undrifting, diagnostics etc) I figured it would be good to separate these two implementations.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most of the recent development on the MemProfiler has been on the Use part. The instrumentation has been quite stable for a while. As the complexity of the use grows (with undrifting, diagnostics etc) I figured it would be good to separate these two implementations.</pre>
</div>
</content>
</entry>
</feed>
