[PATCH] D113897: [GVNSink] Make GVNSink resistant against self referencing instructions (PR36954)

Dawid Jurczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 09:23:52 PDT 2022


yurai007 added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/GVNSink.cpp:582
     ReversePostOrderTraversal<Function*> RPOT(&F);
+    VN.setReachableBBs(collectBlocksReachableFromEntry(F));
+
----------------
nikic wrote:
> Can't you just reuse RPOT here? That is, iterate it into a set? RPOT doesn't visit unreachable blocks, and it is cached, so reusing it is fine.
Thanks for pointing this out. I had to have some kind of mental block to not see how RPOT could be reused in such obvious way.  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113897



More information about the llvm-commits mailing list