[PATCH] D26989: Use continuous boosting factor for complete unroll.

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 14:12:01 PST 2016


danielcdh added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:54
+             "unrolling will reduce the total runtime by X%, we will boost "
+             "the loop unroll threshold to (1/(1-X%))^2. The boost factor "
+             "should not exceed this parameter in order to prevent from "
----------------
mzolotukhin wrote:
> Where is this 1/(1-X^2) come from? To me from the code it looks like:
> ```
> NewThreshold = DefaultThreshold * X^2
> ```
> 
> Also, is there any compelling reason not use a simple linear formula for this?
> E.g.
> ```
> NewThreshold = DefaultThreshold * Y,
> Y = min(RolledCost/UnrolledCost, BoostLimit)
> ```
Thanks for the reviews!

Updated the comment to make it clearer.

No compelling reason, just thought it would be helpful to promote more complete inline when beneficial. Performance experiments does not justify the non-linear equation, so I changed to linear formula instead.


https://reviews.llvm.org/D26989





More information about the llvm-commits mailing list