[PATCH] Use loop unrolling pragma metadata in the loop unroller

Mark Heffernan meheff at google.com
Tue Jun 10 12:04:17 PDT 2014


Hi eliben,

I'm adding loop unrolling pragmas to clang with change (not yet submitted): http://reviews.llvm.org/D4089
This optimizer change consumes the metadata produced from those pragmas and uses them in the loop unroller.

The pragmas must immediately precede a loop statement and take the following forms:

#pragma clang loop unroll(enable)  // unroll the loop completely
#pragma clang loop unroll(disable)  // do not unroll the loop.
#pragma clang loop unroll_count(N)  // unroll the loop N times

These pragmas mirror recently added loop vectorizer pragmas.  If you have comments on the particulars of the syntax and semantics please comment on the clang change.

http://reviews.llvm.org/D4090

Files:
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  test/Transforms/LoopUnroll/unroll-pragmas.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4090.10292.patch
Type: text/x-patch
Size: 13281 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140610/3dde6823/attachment.bin>


More information about the llvm-commits mailing list