[PATCH] D36309: [LoopUnroll] Enable option to peel remainder loop

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 07:17:52 PDT 2017


samparker created this revision.
Herald added a subscriber: mzolotukhin.

On some targets, the penalty of executing runtime unrolling checks and then not the unrolled loop can be significantly detrimental to performance. This results in the need to be more conservative with the unroll count, keeping a trip count of 2 reduces the overhead as well as increasing the chance of the unrolled body being executed. But being conservative leaves performance gains on the table.

      

This patch enables the peeling of the remainder loop introduced by runtime unrolling. This can help reduce the overhead of mis-unrolled loops because the cost of non-taken branches is much less than the cost of the backedge that would normally be executed in the remainder loop. This allows larger unroll factors to be used without suffering performance loses with smaller iteration counts.


https://reviews.llvm.org/D36309

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Transforms/Utils/UnrollLoop.h
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  lib/Transforms/Utils/LoopUnroll.cpp
  lib/Transforms/Utils/LoopUnrollRuntime.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36309.109727.patch
Type: text/x-patch
Size: 7245 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170804/deaf073b/attachment.bin>


More information about the llvm-commits mailing list