[PATCH] D13402: Refactor loop unrolling pass and add optimization remarks

Mark Heffernan via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 17:20:24 PDT 2015


meheff created this revision.
meheff added reviewers: hfinkel, TylerNowicki.
meheff added a subscriber: llvm-commits.
Herald added a subscriber: sanjoy.

This patch adds a full set of optimization remarks (-Rpass, -Rpass-missed, -Rpass-analysis) to the loop unrolling pass similar to what the loop vectorizer has. The logic within LoopUnroll::runOnLoop had gotten quite torturous making coverage of all possible paths with remarks challenging so I refactored the pass. Logic in runOnLoop should hopefully be clearer now.

One small functional change is that "#pragma loop unroll(full)" will not partially unroll loops now. If the loop is too large to fully unroll a warning is emitted and the loop is not unrolled. This makes more sense to me. If the unroller can't satisfy what the user is requesting it should just fail, not do something different but just more aggressive. We have "#pragma loop unroll(enable)" (equivalently "#pragma unroll") to handle the case where you just want the unroller to be more aggressive in general. I happened to notice this during the refactor so I included it in the change. I can make the small doc change in a followup patch.

http://reviews.llvm.org/D13402

Files:
  include/llvm/IR/DiagnosticInfo.h
  lib/IR/DiagnosticInfo.cpp
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  test/Transforms/LoopUnroll/unroll-pragmas.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13402.36414.patch
Type: text/x-patch
Size: 59623 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151003/3f1a94e0/attachment.bin>


More information about the llvm-commits mailing list