[PATCH] Do not add unroll disable metadata after unrolling pass for loops with #pragma clang loop unroll(full)

Mark Heffernan meheff at google.com
Wed Jul 23 11:43:13 PDT 2014


Hi jingyue,

Currently all loop unrolling hint metadata is removed after a loop is unrolled and this metadata is replaced with metadata which disables further unrolling (llvm.loop.unroll.disable).  This makes sense for the hint which specify loop unroll factor, that is "llvm.loop.unroll.count N" which would be added for "#pragma clang loop unroll_count(N)").  This prevents unrolling beyond what the pragma specified.  However, disabling further unrolling doesn't make sense for full unrolling metadata in which we want to keep trying to unroll the loop in subsequent unrolling passes.  This patch fixes this oversight by leaving full unrolling metadata in place after unrolling.

Mark

http://reviews.llvm.org/D4643

Files:
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  test/Transforms/LoopUnroll/unroll-pragmas-disabled.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4643.11815.patch
Type: text/x-patch
Size: 4941 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140723/70033a2e/attachment.bin>


More information about the llvm-commits mailing list