[llvm] 4532512 - [ctxprof] Move `MoveSymbolGUID` to address dependency issues (#134334)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 3 19:02:49 PDT 2025


Author: Mircea Trofin
Date: 2025-04-03T19:02:46-07:00
New Revision: 4532512f6c2558fa7d5ba9f35fbce7bad76c1380

URL: https://github.com/llvm/llvm-project/commit/4532512f6c2558fa7d5ba9f35fbce7bad76c1380
DIFF: https://github.com/llvm/llvm-project/commit/4532512f6c2558fa7d5ba9f35fbce7bad76c1380.diff

LOG: [ctxprof] Move `MoveSymbolGUID` to address dependency issues (#134334)

See PR #134192

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/FunctionImport.cpp
    llvm/lib/Transforms/Utils/FunctionImportUtils.cpp

Removed: 
    


################################################################################
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,


        


More information about the llvm-commits mailing list