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

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 13:32:30 PST 2016


danielcdh created this revision.
danielcdh added a reviewer: mzolotukhin.
danielcdh added a subscriber: llvm-commits.

The current loop complete unroll algorithm checks if unrolling complete will reduce the runtime by a certain percentage. If yes, it will apply a fixed boosting factor to the threshold (by discounting cost). The problem for this approach is that the threshold abruptly. This patch makes the boosting factor a function of runtime reduction percentage, capped by a fixed threshold. In this way, the threshold changes continuously.

The patch also simplified the code by reducing one parameter in UP.

The patch only affects code-gen of two speccpu2006 benchmark:

445.gobmk binary size decreases 0.08%, no performance change.
464.h264ref binary size increases 0.24%, no performance change.


https://reviews.llvm.org/D26989

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  lib/Transforms/InstCombine/InstCombinePHI.cpp
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  test/Transforms/LoopUnroll/full-unroll-crashers.ll
  test/Transforms/LoopUnroll/full-unroll-heuristics-2.ll
  test/Transforms/LoopUnroll/full-unroll-heuristics-cmp.ll
  test/Transforms/LoopUnroll/full-unroll-heuristics-dce.ll
  test/Transforms/LoopUnroll/full-unroll-heuristics-geps.ll
  test/Transforms/LoopUnroll/full-unroll-heuristics-phi-prop.ll
  test/Transforms/LoopUnroll/full-unroll-heuristics.ll
  test/Transforms/LoopUnroll/partial-unroll-const-bounds.ll
  test/Transforms/LoopUnroll/unroll-heuristics-pgo.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26989.78933.patch
Type: text/x-patch
Size: 20913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161122/fbdc4371/attachment-0001.bin>


More information about the llvm-commits mailing list