[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 12:50:09 PDT 2021


Whitney accepted this revision.
Whitney added a comment.
This revision is now accepted and ready to land.

One minor comment, other than that LGTM.



================
Comment at: llvm/lib/Transforms/Utils/CodeMoverUtils.cpp:440
+                                   const PostDominatorTree *PDT) {
+  const BasicBlock *CommonDominator =
+      DT->findNearestCommonDominator(ThisBlock, OtherBlock);
----------------
congzhe wrote:
> Whitney wrote:
> > How about adding `assert(isControlFlowEquivalent(*ThisBlock, *OtherBlock, *DT, *PDT));`?
> Thanks, all comments addressed.
>  make sure to put some kind of error message in the assertion statement
https://llvm.org/docs/CodingStandards.html#assert-liberally


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

https://reviews.llvm.org/D110456



More information about the llvm-commits mailing list