[PATCH] D22778: Add Loop Sink pass to reverse the LICM based of basic block frequency.

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 11:41:13 PDT 2016


On Mon, Oct 17, 2016 at 11:36 AM, David Li <davidxl at google.com> wrote:

> davidxl added a comment.
>
> M is the number of use BBs.
>
> The pass already filters out loops which do not have any cold blocks --
> this effectively filters out most of the loops in reality so the compile
> time impact will be minimal. Further more, the following can be done:
>
> 1. only collect cold bbs in the loop body that is colder than header and
> sort them instead
>

This was already done before sorting:

  for (BasicBlock *B : L.blocks())
​    if (BFI.getBlockFreq(B) <= BFI.getBlockFreq(L.getLoopPreheader())) {
​      SortedLoopBBs.push_back(B);
​      LoopBlockNumber[B] = ++i;
​    }


> 2. skip any instructions with use BBs that are not member of the cold BBs
> collected in 1).
>

This may not be optimal because one inst may have use in a hot BB, but may
have BB's parent (int DT) very code. So we can sink to the cold parent.

Dehao


>
>
> https://reviews.llvm.org/D22778
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161017/fc83c604/attachment.html>


More information about the llvm-commits mailing list