[llvm] [ElimAvailExtern] Add an option to allow to convert global variables in a specified address space to local (PR #144287)
Mircea Trofin via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 16 08:29:34 PDT 2025
================
@@ -35,8 +35,14 @@ static cl::opt<bool> ConvertToLocal(
cl::desc("Convert available_externally into locals, renaming them "
"to avoid link-time clashes."));
+static cl::opt<unsigned> ConvertGlobalVariableInAddrSpace(
+ "avail-extern-gv-in-addrspace-to-local", cl::Hidden,
+ cl::desc(
+ "Convert available_externally global variables into locals if they are "
+ "in specificed addrspace, renaming them to avoid link-time clashes."));
+
STATISTIC(NumRemovals, "Number of functions removed");
-STATISTIC(NumConversions, "Number of functions converted");
+STATISTIC(NumConversions, "Number of functions and globals converted");
----------------
mtrofin wrote:
would it help if we split this statistic in `NumFunctionsConverted` and `NumGlobalVariablesConverted`?
https://github.com/llvm/llvm-project/pull/144287
More information about the llvm-commits
mailing list