[PATCH] D86319: [Attributor] Introduce module slice.

Kuter Dinel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 18:39:25 PDT 2020


kuter added a comment.

This is interesting, I thought you couldn't change the IR outside of the current SCC.
Was this intended to go on top of D86081 <https://reviews.llvm.org/D86081> ?



================
Comment at: llvm/include/llvm/Transforms/IPO/Attributor.h:765
+  /// a function in the SCC or a caller of a function in the SCC.
+  void initializeModuleSlice(SetVector<Function *> &SCC) {
+    ModuleSlice.insert(SCC.begin(), SCC.end());
----------------
I don't think this is needed. If you just seed the SCC, the AAs won't query anything outside of this anyways.


================
Comment at: llvm/include/llvm/Transforms/IPO/Attributor.h:1080-1082
     // We can initialize (=look at) code outside the current function set but
     // not call update because that would again spawn new abstract attributes in
     // potentially unconnected code regions (=SCCs).
----------------
Documentation


================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:3039
     if (F && !F->isDeclaration()) {
-      ToBeExploredFrom.insert(&F->getEntryBlock().front());
-      assumeLive(A, F->getEntryBlock());
+      if (A.isRunOn(*const_cast<Function *>(F))) {
+        ToBeExploredFrom.insert(&F->getEntryBlock().front());
----------------
I think this to not spend too much time on functions that are outside of the current SCC right ?
Can you add comments.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86319



More information about the llvm-commits mailing list