[compiler-rt] [llvm] [ThinLTO][TypeProf] Import local-linkage global var for mod1:func_foo-> mod2:local-var edge (PR #100448)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 16:08:00 PDT 2024


================
@@ -174,6 +174,17 @@ static cl::opt<std::string> WorkloadDefinitions(
              "}"),
     cl::Hidden);
 
+static cl::opt<bool> ImportAssumeUniqueLocal(
+    "import-assume-unique-local", cl::init(false),
+    cl::desc(
+        "By default, a local-linkage global variable won't be imported in the "
+        "edge mod1:func -> mod2:local-var (from value profiles) since compiler "
+        "cannot assume mod2 is compiled with full path which gives local-var a "
+        "program-wide unique GUID. Set this option to true will help cross "
+        "module import of such variables. This is only safe if the compiler "
----------------
minglotus-6 wrote:

The test program itself is correct as there are only two files and they don't have conflict names.

I'm open to update it to use the full path if that is preferred or better.

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


More information about the llvm-commits mailing list