[LLVMdev] Question regarding basic-block placement optimization

Andrew Trick atrick at apple.com
Sun Oct 23 11:51:24 PDT 2011

On Oct 23, 2011, at 1:11 AM, Chandler Carruth <chandlerc at google.com> wrote:

> I don't care much about how you layout the cold chains as long as they
> are not interleaved with the rest of the code, thus breaking the
> topological ordering and forcing extra branches. In practice, this
> means they get their own little Siberia after the function return,
> effectively splitting the function into two sections. However, the
> notion of "coldness" is really relative to the current loop head.
> I've not really tried to ensure this happens correctly. Mostly, this is just forming hot-paths through the code when they are *really* hot. I'll work on better sectioning off the cold paths that are cut off in a followup patch.

Once you move a block " out of line" it will naturally end up floating to the end of the function when you do a good job splicing the other warm chains. So I don't think it needs to be explicit in the design. The explicit decision is simply when to move a chain out of line ( no longer topplogical). 

Depending on the algorithm you may need to do some work to ensure loops are followed by their "best" loop exit. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111023/a6144364/attachment.html>

More information about the llvm-dev mailing list