[PATCH] D54730: [DomTree] Fix order of domtree updates in MergeBlockIntoPredecessor.

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 20 11:34:08 PST 2018


kuhar added inline comments.


================
Comment at: lib/Transforms/Utils/BasicBlockUtils.cpp:163
   // DTU update: Collect all the edges that exit BB.
   // These dominator edges will be redirected from Pred.
   std::vector<DominatorTree::UpdateType> Updates;
----------------
I would appreciate a comment explaining that the order of updates matter in this place, in case we want to revisit it some time later.


================
Comment at: lib/Transforms/Utils/BasicBlockUtils.cpp:167
     Updates.reserve(1 + (2 * succ_size(BB)));
+    for (auto I = succ_begin(BB), E = succ_end(BB); I != E; ++I)
+      Updates.push_back({DominatorTree::Insert, PredBB, *I});
----------------
nit: We could use a range-based for loop here instead (and also in the loop below)


Repository:
  rL LLVM

https://reviews.llvm.org/D54730





More information about the llvm-commits mailing list