[llvm] be7e411 - [NFC] Add comment to describe the intention use of newly added `avail-extern-gv-in-addrspace-to-local` (#144911)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 20 15:55:45 PDT 2025


Author: Shilei Tian
Date: 2025-06-20T18:55:41-04:00
New Revision: be7e4113c84317feda055cac68a855429e46e381

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

LOG: [NFC] Add comment to describe the intention use of newly added `avail-extern-gv-in-addrspace-to-local` (#144911)

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/ElimAvailExtern.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/ElimAvailExtern.cpp b/llvm/lib/Transforms/IPO/ElimAvailExtern.cpp
index bc98f994f490c..538755e66f9cf 100644
--- a/llvm/lib/Transforms/IPO/ElimAvailExtern.cpp
+++ b/llvm/lib/Transforms/IPO/ElimAvailExtern.cpp
@@ -35,6 +35,10 @@ static cl::opt<bool> ConvertToLocal(
     cl::desc("Convert available_externally into locals, renaming them "
              "to avoid link-time clashes."));
 
+// This option was originally introduced to correctly support the lowering of
+// LDS variables for AMDGPU when ThinLTO is enabled. It can be utilized for
+// other purposes, but make sure it is safe to do so, as privatizing global
+// variables is generally not safe.
 static cl::opt<unsigned> ConvertGlobalVariableInAddrSpace(
     "avail-extern-gv-in-addrspace-to-local", cl::Hidden,
     cl::desc(


        


More information about the llvm-commits mailing list