[llvm-branch-commits] [llvm] [StaticDataLayout] Factor out a helper function for section prefix eligibility and use it in both optimizer and codegen (PR #162348)

Mingming Liu via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Oct 8 15:50:18 PDT 2025


================
@@ -75,7 +75,7 @@ bool StaticDataAnnotator::runOnModule(Module &M) {
 
   bool Changed = false;
   for (auto &GV : M.globals()) {
-    if (GV.isDeclarationForLinker())
+    if (!llvm::memprof::IsAnnotationOK(GV))
----------------
mingmingl-llvm wrote:

> But are the effects of this change and the other one I mentioned earlier not observable by tests?

Yeah, the test coverage is limited to [1] before. Improved the test coverage now, PTAL, thanks!


[1] https://github.com/llvm/llvm-project/blob/139a6bf0e448ebd7ef9bd1c26aa92018d90f8add/llvm/test/Transforms/PGOProfile/data-access-profile.ll#L28-L29

https://github.com/llvm/llvm-project/pull/162348


More information about the llvm-branch-commits mailing list