[PATCH] D43826: LoopUnroll: respect pragma unroll when AllowRemainder is disabled

Yaxun Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 09:39:21 PST 2018


yaxunl created this revision.
yaxunl added reviewers: nhaehnle, efriedma, jlebar.
Herald added a subscriber: Anastasia.

Currently when AllowRemainder is disabled, pragma unroll count is not
respected even though there is no remainder. This bug causes a loop
fully unrolled in many cases even though the user specifies a unroll
count. Especially it affects OpenCL/CUDA since in many cases a loop
contains convergent instructions and currently AllowRemainder is
disabled for such loops.

This patch is related to https://reviews.llvm.org/D43594 but that one
deals with situations where remainder exists.


https://reviews.llvm.org/D43826

Files:
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  test/Transforms/LoopUnroll/convergent.ll
  test/Transforms/LoopUnroll/unroll-pragmas.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43826.136090.patch
Type: text/x-patch
Size: 3683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180227/f8cef436/attachment.bin>


More information about the llvm-commits mailing list