[PATCH] D18226: Codegen: Tail-duplicate during placement.

Kyle Butt via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 17:04:55 PDT 2016


iteratee added inline comments.

================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:1862
@@ +1861,3 @@
+/// \p DuplicatedToLPred - True if the block was duplicated into LPred. Will
+///                        only be true if Removed is also true.
+void MachineBlockPlacement::maybeTailDuplicateBlock(
----------------
davidxl wrote:
> Is this comment correct? The TailBB may be dup'ed in to Lpred, but still not removed as there are some other predecessors it can not be dup'ed into ?
It is currently correct.
The tail duplication code only copies the block into the layout predecessor if it can be copied into all other predecessors as well.

================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:1951
@@ +1950,3 @@
+
+  DuplicatedToLPred = Removed && CanDupToChain;
+}
----------------
davidxl wrote:
> Should DuplicatedToLPred == CanDupToChain?
Even better, since we now return the list of predecessors that received a copy of BB, we should check to see if LPred is in that list. Basically free since we loop over the list anyway.


https://reviews.llvm.org/D18226





More information about the llvm-commits mailing list