[PATCH] D54223: WIP... [SimpleLoopUnswitch] adding cost multiplier to cap exponential unswitch with

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 7 19:06:08 PST 2018


skatkov added a comment.

In general I think it is what we can go/start with.
This formula seems to be a bit pessimistic. Specifically not every candidate creates sibling loops. Only if all successors is in loop or there are sub-loops before unswitch candidate. So applying the power multiplier for this candidates seems unreasonable.
Also it is possible that several unswitch candidates can be done at one shot (the same condition), in this case the number of siblings will not grow so fast.
But these improvements can be done as a follow-up if needed.

General comment, please consider to extract the helper function findBestUnswitchCandidate to get these computation in one place because it becomes not so trivial.


Repository:
  rL LLVM

https://reviews.llvm.org/D54223





More information about the llvm-commits mailing list