[llvm] [AsmPrinter] Always emit global equivalents if there is non-global uses (PR #145648)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 25 00:49:34 PDT 2025
================
@@ -151,8 +151,12 @@ class LLVM_ABI AsmPrinter : public MachineFunctionPass {
/// Map global GOT equivalent MCSymbols to GlobalVariables and keep track of
/// its number of uses by other globals.
- using GOTEquivUsePair = std::pair<const GlobalVariable *, unsigned>;
- MapVector<const MCSymbol *, GOTEquivUsePair> GlobalGOTEquivs;
+ struct GOTEquivUse {
+ const GlobalVariable *GV;
+ unsigned NumUses;
+ bool HasNonGlobalUsers;
----------------
nikic wrote:
This breaks the ABI, so we will not be able to backport it in this form (though I'm not sure if there will be another LLVM 20 release). An alternative would be to make the number of uses the total number of uses (rather than global variable uses). Or even just adding 1 to it for non-global users would also work.
https://github.com/llvm/llvm-project/pull/145648
More information about the llvm-commits
mailing list