[PATCH] D63046: [Attributor] Deduce "willreturn" function attribute

Nick Lewycky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 13:38:05 PDT 2019


nicholas added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:1115-1120
+    Visited.insert(BB);
+    for (auto *SuccBB : successors(BB)) {
+      if (Visited.count(SuccBB))
+        return true;
+    }
+  }
----------------
jdoerfert wrote:
> nicholas wrote:
> > FYI, with effort, this could be pushed to be more efficient. df_iterator maintains its own copy of Visited, and it does its own scan over the successors of the block, neither of which need to be done twice. Unfortunately the fix is not entirely simple.
> Let's not optimize it preemptively. I'll run it through LLVM-TS and SPEC2006 before I commit it anyway, if there is a change in compile or runtime I'll report it back.
I doubt human-written code will trigger slow compile times in this path, but I bet it could happen with machine generated code. Just leave a TODO noting how it could be more efficient.


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

https://reviews.llvm.org/D63046





More information about the llvm-commits mailing list