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

Kyle Butt via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 16 14:42:09 PDT 2016

iteratee created this revision.
iteratee added a reviewer: chandlerc.
iteratee added subscribers: echristo, timshen, llvm-commits.
iteratee set the repository for this revision to rL LLVM.

The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18226.50874.patch
Type: text/x-patch
Size: 19662 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160316/1fb591e3/attachment.bin>

More information about the llvm-commits mailing list