[PATCH] D62981: [DomTreeUpdater] Add all insert before all delete updates to reduce compile time.

Chijun Sima via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 02:21:23 PDT 2019


NutshellySima added a comment.

Thanks for the patch! I believe that the modification here fulfills the precondition of calling mutation APIs of the `DomTreeUpdater`.
B.T.W., After seeing this patch, I recalled a not-merged patch, D54730 <https://reviews.llvm.org/D54730>, which has the same motivation and similar modifications.
I think "sorting updates so that insertions always happen before deletions" needs to be analyzed case-by-case, as there isn't enough evidence that the updating process will always be faster that way.



================
Comment at: lib/Transforms/Utils/BasicBlockUtils.cpp:215
     Updates.reserve(1 + (2 * succ_size(BB)));
-    Updates.push_back({DominatorTree::Delete, PredBB, BB});
-    for (auto I = succ_begin(BB), E = succ_end(BB); I != E; ++I) {
-      Updates.push_back({DominatorTree::Delete, BB, *I});
+    // Add insert edges first.
+    for (auto I = succ_begin(BB), E = succ_end(BB); I != E; ++I)
----------------
I would like the comment here explaining the order of updates matters the performance. :)


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62981





More information about the llvm-commits mailing list