[llvm] [ElimAvailExtern] Add an option to allow to convert global variables in a specified address space to local (PR #144287)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 17 08:57:15 PDT 2025


================
@@ -45,6 +52,10 @@ void deleteFunction(Function &F) {
   ++NumRemovals;
 }
 
+static std::string getNewName(Module &M, const GlobalValue &GV) {
+  return GV.getName().str() + ".__uniq" + getUniqueModuleId(&M);
----------------
shiltian wrote:

I tried that route but not sure if that would be better. The new name is used at L85 as well. If we are gonna have a function that does both rename and set linkage, it also needs to return the new name for L85, which I find the semantics of it weird.

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


More information about the llvm-commits mailing list