[PATCH] D28368: Give higher full-unroll boosting when the loop iteration is small.

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 13:46:36 PST 2017

danielcdh added a comment.

In https://reviews.llvm.org/D28368#648614, @efriedma wrote:

> It looks like this makes UnrollingPreferences::Threshold essentially unused?  We already have a separate threshold for runtime/partial unrolling; it just isn't exposed as a command-line option.

It's still used here:

  // Check for explicit Count.
  // 1st priority is unroll count set by "unroll-count" option.
  bool UserUnrollCount = UnrollCount.getNumOccurrences() > 0;
  if (UserUnrollCount) {
    UP.Count = UnrollCount;
    UP.AllowExpensiveTripCount = true;
    UP.Force = true;
    if (UP.AllowRemainder && getUnrolledLoopSize(LoopSize, UP) < UP.Threshold)
      return true;

You are right, partial unroll and runtime unroll uses UP.PartialThreshold which was set the same as UP.Threshold. Any recommendations on how to make this less confusing?


More information about the llvm-commits mailing list