Skip to content

[ctxprof] Move MoveSymbolGUID to address dependency issues #134334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

mtrofin
Copy link
Member

@mtrofin mtrofin commented Apr 4, 2025

See PR #134192

@llvmbot llvmbot added LTO Link time optimization (regular/full LTO or ThinLTO) llvm:transforms labels Apr 4, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 4, 2025

@llvm/pr-subscribers-llvm-transforms

@llvm/pr-subscribers-lto

Author: Mircea Trofin (mtrofin)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/134334.diff

2 Files Affected:

  • (modified) llvm/lib/Transforms/IPO/FunctionImport.cpp (+1-8)
  • (modified) llvm/lib/Transforms/Utils/FunctionImportUtils.cpp (+8-1)
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index d93bd44de52fe..f1dce5d7904f9 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -182,14 +182,7 @@ static cl::opt<bool> CtxprofMoveRootsToOwnModule(
              "their own module."),
     cl::Hidden, cl::init(false));
 
-cl::list<GlobalValue::GUID> MoveSymbolGUID(
-    "thinlto-move-symbols",
-    cl::desc(
-        "Move the symbols with the given name. This will delete these symbols "
-        "wherever they are originally defined, and make sure their "
-        "linkage is External where they are imported. It is meant to be "
-        "used with the name of contextual profiling roots."),
-    cl::Hidden);
+extern cl::list<GlobalValue::GUID> MoveSymbolGUID;
 
 namespace llvm {
 extern cl::opt<bool> EnableMemProfContextDisambiguation;
diff --git a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
index 81e461e28df17..3bbe875bbe9e5 100644
--- a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
+++ b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp
@@ -24,7 +24,14 @@ static cl::opt<bool> UseSourceFilenameForPromotedLocals(
              "This requires that the source filename has a unique name / "
              "path to avoid name collisions."));
 
-extern cl::list<GlobalValue::GUID> MoveSymbolGUID;
+cl::list<GlobalValue::GUID> MoveSymbolGUID(
+    "thinlto-move-symbols",
+    cl::desc(
+        "Move the symbols with the given name. This will delete these symbols "
+        "wherever they are originally defined, and make sure their "
+        "linkage is External where they are imported. It is meant to be "
+        "used with the name of contextual profiling roots."),
+    cl::Hidden);
 
 FunctionImportGlobalProcessing::FunctionImportGlobalProcessing(
     Module &M, const ModuleSummaryIndex &Index,

@mtrofin mtrofin changed the title [ctxprof] Move the flag introduced in PR #134192 to address dependency issues [ctxprof] Move MoveSymbolGUID to address dependency issues Apr 4, 2025
@mtrofin mtrofin merged commit 4532512 into llvm:main Apr 4, 2025
9 of 14 checks passed
@mtrofin mtrofin deleted the fix branch April 4, 2025 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:transforms LTO Link time optimization (regular/full LTO or ThinLTO)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants