[PATCH] D35804: [BPI] Detect branches in loops that make themselves not taken

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 5 10:52:47 PDT 2017


hfinkel added a comment.

In https://reviews.llvm.org/D35804#881223, @john.brawn wrote:

> In https://reviews.llvm.org/D35804#833008, @davidxl wrote:
>
> > This code looks fine to me. My next question is, is the pattern common? The amount of code and possible compile increase added is non trivial.
>
>
> I've finally gotten around to gathering some data on this. Over the entire LLVM test suite (which may or may not be a useful data set, I don't know), for each call to computeUnlikelySuccessors:
>
> - 56% execute the first loop (i.e. the block does a conditional branch based on a compare with a constant)
> - 19% execute the second loop (i.e. we found a suitable phi node)
> - 0.11% insert at least one element into UnlikelyBlocks
>
>   I measured the increase to the overall buildtime of the LLVM test suite as 2%.


How confident are you in this increase? Is this noise? An actual 2% increase in compile time seems expensive for what this is doing.


Repository:
  rL LLVM

https://reviews.llvm.org/D35804





More information about the llvm-commits mailing list