[PATCH] D154052: Refactor some BasicBlockUtils functions (NFC)

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 00:36:43 PDT 2023


dmgreen added a comment.

LGTM along with D154053 <https://reviews.llvm.org/D154053>.



================
Comment at: llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h:467
+///
+/// If \p ThenBlock is null, the resulting CFG won't containthe TrueBlock. If
+/// \p ThenBlock is non-null and points to non-null BasicBlock pointer, that block
----------------
containthe -> contain the


================
Comment at: llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h:473
+/// blocks will end with UnreachableInst, otherwise with branches to Tail.
+/// The function will not modify existing basic blocks, passed to it. The caller
+/// must ensure that Tail is reachable from Head.
----------------
Maybe remove the comma?


================
Comment at: llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:1525
+  bool ElseToTailEdge = false;
+  if (ThenBlock) {
+    if (*ThenBlock)
----------------
Could this be made into a little lambda for the true and false blocks?


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

https://reviews.llvm.org/D154052



More information about the llvm-commits mailing list