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

John Brawn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 15:31:17 PDT 2017


john.brawn added a comment.

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%.


Repository:
  rL LLVM

https://reviews.llvm.org/D35804





More information about the llvm-commits mailing list