[PATCH] D11410: [GMR] Teach GlobalsModRef to distinguish an important and safe case of no-alias with non-addr-taken globals: they cannot alias a captured pointer.

Michael Zolotukhin mzolotukhin at apple.com
Fri Jul 24 11:32:59 PDT 2015

mzolotukhin added a comment.

Hi Chandler,

I did some preliminary testing again, and it seems that this patch resolves the biggest regressions we saw:

  More than 0.5% changes:
  Benchmark       Old     New     Delta
  403.gcc         435.53  415.91  -4.50%
  445.gobmk       875.12  866.1   -1.03%
  458.sjeng       1045.91 1035.76 -0.97%

We observed some other smaller regressions too, but I think my setup is too noisy to detect an effect on them.

Overall the change seems reasonable to me, one question though:

Comment at: lib/Analysis/IPA/GlobalsModRef.cpp:716-721
@@ +715,8 @@
+        return NoAlias;
+      } else if (auto *LI = dyn_cast<LoadInst>(UV)) {
+        // A pointer loaded from a global would have been captured, and we know
+        // that GV is non-addr-taken, so no alias.
+        if (isa<GlobalValue>(LI->getPointerOperand()))
+          return NoAlias;
+      }
+    }
Could you please give an example of how a load from non-global could alias with non-addr-taken global?


More information about the llvm-commits mailing list