[PATCH] D110456: [CodeMoverUtils] Enhance isSafeToMoveBefore() when control flow equivalence is satisfied

Whitney Tsang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 27 07:09:31 PDT 2021


Whitney added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/CodeMoverUtils.cpp:440
+                                   const PostDominatorTree *PDT) {
+  const BasicBlock *CommonDominator =
+      DT->findNearestCommonDominator(ThisBlock, OtherBlock);
----------------
How about adding `assert(isControlFlowEquivalent(*ThisBlock, *OtherBlock, *DT, *PDT));`?


================
Comment at: llvm/lib/Transforms/Utils/CodeMoverUtils.cpp:446
+  /// Recursively check the predecessors of \p ThisBlock up to
+  /// their common dominator, and see if any or them post-dominates
+  /// \p OtherBlock.
----------------
typo: any or them


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110456



More information about the llvm-commits mailing list