[PATCH] D27742: CodeGen: Allow small copyable blocks to "break" the CFG.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 12:44:06 PST 2016

davidxl added a comment.

Please add one or two test cases for this feature.

Comment at: lib/CodeGen/MachineBlockPlacement.cpp:568
+  if (!IsSimple && BB->succ_size() == 1)
+    return false;
&& --> || ?

In other words, do we care about block dup of simple blocks in layout mode?

Comment at: lib/CodeGen/MachineBlockPlacement.cpp:581
+/// tail-duplication and lay them out in the same manner.
+bool MachineBlockPlacement::canTailDuplicateAllPreds(
+    MachineBasicBlock *BB, MachineBasicBlock *Succ, BlockChain &Chain,
Perhaps change the name to "canTailDuplicateUnplacedPreds" ?

Comment at: lib/CodeGen/MachineBlockPlacement.cpp:593
+      continue;
+    if (!TailDup.canTailDuplicate(Succ, Pred))
+      return false;
We have have a situation where some of the predecessors can share a common successor (newly created), and the block can be tail-Duped into that block.  It might be worth considering supporting.



More information about the llvm-commits mailing list