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

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 29 13:51:34 PST 2016


chandlerc accepted this revision.
chandlerc added a comment.

I'm good with the patch now, thanks (see nit picks below, but no need to refresh the patch, just fix prior to submitting).

I would like to see at least code size numbers for the llvm test suite benchmarks before you submit. (I'm interested if there are runtime changes, but not really worried about them.) If the code size doesn't regress significantly (as SPEC doesn't), LGTM.



================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:54
+             "dynamic cost savings. If completely unrolling a loop will reduce "
+             "the total runtime from X to Y, we boost the lop unroll threshold "
+             "to DefaultThreshold*std::min(MaxPercentThresholdBoost, X/Y). "
----------------
lop -> loop


================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:762-763
+        if (Cost->UnrolledCost <
+            UP.Threshold * getFullUnrollBoostingFactor(
+                               *Cost, UP.MaxPercentThresholdBoost) / 100) {
           UseUpperBound = (MaxTripCount == FullUnrollTripCount);
----------------
I think this will format in an easier to read way with a variable like `Boost`.


https://reviews.llvm.org/D26989





More information about the llvm-commits mailing list