[PATCH] D87293: [GVN] Fix undef incoming value for phi node when new loop exit block created.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 15:59:22 PDT 2020


asbirlea added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/GVN.cpp:2751
     }
 
+    for (BasicBlock *C : Candidates) {
----------------
Could you please explain in more details the mechanics here? 
When added into Candidates, the llvm::any_of condition is true. What makes the condition become false below?
What's the purpose of the intersection of non-dead succs and preds?


================
Comment at: llvm/lib/Transforms/Scalar/GVN.cpp:2763
+                     [&](BasicBlock *Pred) { return !DeadBlocks.count(Pred); });
+        std::vector<BasicBlock *> NewBolcks;
+        std::set_intersection(Succs.begin(), Succs.end(), Preds.begin(),
----------------
s/NewBolcks/NewBlocks


Repository:
  rZORG LLVM Github Zorg

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

https://reviews.llvm.org/D87293



More information about the llvm-commits mailing list