[PATCH] D80583: Create utility function to Merge Adjacent Basic Blocks

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 13:03:01 PDT 2020


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

Thanks! LGTM with 2 nits in the comment section.



================
Comment at: llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h:103
+/// In order to merge, each block must be terminated by an unconditional
+/// branch and if L is provided, then the blocks merged into their predecessors
+/// must be in L. In addition, a call to MergeBlockIntoPredecessor must return
----------------
Nit: s/branch and if L/branch. If L/




================
Comment at: llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h:104
+/// branch and if L is provided, then the blocks merged into their predecessors
+/// must be in L. In addition, a call to MergeBlockIntoPredecessor must return
+/// true, when the block following the current MergeBlock (the sucessor of the
----------------
This reads as: the call to `MergeBlockIntoPredecessor` must always return true, which is not the case.
I think what you mean is:

"This utility calls on another utility: `MergeBlockIntoPredecessor`. Blocks are successfully merged when the call to MergeBlockIntoPredecessor returns true."


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

https://reviews.llvm.org/D80583





More information about the llvm-commits mailing list