[PATCH] D119571: [funcattrs] use DominatorTree to improve noreturn

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 11 13:22:09 PST 2022


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:1619
+  SmallVector<BasicBlock *, 16> Worklist;
+  SmallSetVector<BasicBlock *, 16> Visited;
+
----------------
SmallPtrSet, you don't care about iteration order here.


================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:1627-1630
+    if (!Visited.insert(BB))
+      continue;
+    for (BasicBlock *Succ : successors(BB))
+      Worklist.push_back(Succ);
----------------
A bit better to avoid pushing to the worklist in the first place.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119571



More information about the llvm-commits mailing list