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

Michael Zolotukhin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 12:21:36 PST 2016

mzolotukhin 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 "
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?
NewThreshold = DefaultThreshold * Y,
Y = min(RolledCost/UnrolledCost, BoostLimit)


More information about the llvm-commits mailing list