[llvm] [globals-aa] Improved isNonEscapingGlobalNoAlias. (PR #127707)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 14:57:01 PST 2025


================
@@ -762,6 +763,18 @@ bool GlobalsAAResult::isNonEscapingGlobalNoAlias(const GlobalValue *GV,
       continue;
     }
 
+    // A non-addr-taken global cannot alias with any non-pointer value.
+    if (!Input->getType()->isPointerTy())
+      continue;
+
+    if (CtxI) {
+      // Null pointer cannot alias with a non-addr-taken global.
+      const Function *F = CtxI->getFunction();
----------------
efriedma-quic wrote:

Sink the variable declaration into the `if`?

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


More information about the llvm-commits mailing list