Skip to content

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