[PATCH] D17329: [AA] Hoist the logic to reformulate various AA queries in terms of other parts of the AA interface out of the base class of every single AA result object.

Gerolf Hoflehner via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 16:49:14 PST 2016


Gerolf added a subscriber: Gerolf.

================
Comment at: lib/Analysis/AliasAnalysis.cpp:139
@@ +138,3 @@
+  // aggregate set of AA results.
+  auto MRB = getModRefBehavior(CS);
+  if (MRB == FMRB_DoesNotAccessMemory)
----------------
This routine queries AA again but this time for behavior rather than ModRefInfo, but the result (no mod ref info) could be the same. Can this be combined in some meta routine so that no mod ref is spit out early? The AA loops can be very compile-time expensive so we should avoid/shorten them when possible.

================
Comment at: lib/Analysis/AliasAnalysis.cpp:149
@@ +148,3 @@
+    ModRefInfo AllArgsMask = MRI_NoModRef;
+    if (doesAccessArgPointees(MRB)) {
+      for (auto AI = CS.arg_begin(), AE = CS.arg_end(); AI != AE; ++AI) {
----------------
Could you refactor into a function?

================
Comment at: lib/Analysis/AliasAnalysis.cpp:171
@@ +170,3 @@
+  // modify the memory location.
+  if ((Result & MRI_Mod) &&
+      pointsToConstantMemory(Loc, /*OrLocal*/ false))
----------------
Why could Mod be set in this case? Wouldn't that be a bug?

================
Comment at: lib/Analysis/AliasAnalysis.cpp:194
@@ +193,3 @@
+  // If CS1 or CS2 are readnone, they don't interact.
+  auto CS1B = getModRefBehavior(CS1);
+  if (CS1B == FMRB_DoesNotAccessMemory)
----------------
See above

================
Comment at: lib/Analysis/AliasAnalysis.cpp:244
@@ +243,3 @@
+  // any of the memory referenced by CS1's arguments. If not, return NoModRef.
+  if (onlyAccessesArgPointees(CS1B)) {
+    ModRefInfo R = MRI_NoModRef;
----------------
Separate function?


http://reviews.llvm.org/D17329





More information about the llvm-commits mailing list