[PATCH] D31558: CodeGen: BranchFolding: Merge identical blocks, even if they are short.

Kyle Butt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 12:30:23 PDT 2017


iteratee added inline comments.


================
Comment at: lib/CodeGen/BranchFolding.cpp:604
+  // If both blocks are identical, merge them.
+  if (I1 == MBB1->begin() && I2 == MBB2->begin())
+    return true;
----------------
davidxl wrote:
> This may have bad effect on block layout if tail dup can recover from it. For instance, when both MBB1 and MBB2 have fall through successors. 
Currently tail-duplication only copies instructions to the ends of blocks with unconditional jumps, so this won't conflict with tail-duplication.
I could add a check that at least one of the blocks can't fall through, then it would be future proof if we start copying blocks during layout.


Repository:
  rL LLVM

https://reviews.llvm.org/D31558





More information about the llvm-commits mailing list