[PATCH] D73428: [Attributor] Improve `noalias` deduction based on memory information

Hideto Ueno via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 17 03:05:36 PST 2020


uenoku added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:2769
+  /// potential aliases to the underlying call site argument. That is, if the
+  /// call site argument does not alias any argument or global which is accessed
+  /// by the callee it can be marked noalias.
----------------
Don't we need to look at constant memories?


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:2830-2837
+      bool IsAliasing = !AAR || !AAR->isNoAlias(&getAssociatedValue(), Ptr);
+      LLVM_DEBUG(dbgs() << "[AANoAlias] Check alias at "
+                           "callsite: "
+                        << getAssociatedValue() << " | " << *Ptr << " => "
+                        << (IsAliasing ? "" : "no-") << "alias \n");
+
+      return !IsAliasing;
----------------
Please make a helper for
```
if(!AAR) AAR = ..
bool IsAliasing = !AAR | !AAR->isNoAlias(..);
```


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:2924
+        AAMemoryLocation::ALL_LOCATIONS | AAMemoryLocation::NO_LOCAL_MEM |
+        AAMemoryLocation::NO_INACCESSIBLE_MEM;
+
----------------
How about `NO_MALLOCED_MEM`?



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73428/new/

https://reviews.llvm.org/D73428





More information about the llvm-commits mailing list