[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:42:59 PDT 2025
================
@@ -2142,16 +2144,20 @@ void AsmPrinter::emitFunctionBody() {
}
/// Compute the number of Global Variables that uses a Constant.
-static unsigned getNumGlobalVariableUses(const Constant *C) {
- if (!C)
+static unsigned getNumGlobalVariableUses(const Constant *C,
+ bool &HasNonGlobalUsers) {
+ if (!C) {
+ HasNonGlobalUsers = true;
return 0;
+ }
----------------
nikic wrote:
I think you'd still need it for the recursive case. It would be good to add a test where the extra uses are in getelementptr constant expressions.
https://github.com/llvm/llvm-project/pull/145648
More information about the llvm-commits
mailing list