Piggy-backing on the support for "#pragma clang loop vectorize..." which was added recently by Tyler. This patch adds support for loop unrolling pragmas. 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
if both unroll(enable) and unroll_count(N) are specified then the unroll_count takes precedence (ie, unroll the loop N times).
Tyler, I changed the logic a bit in CheckForIncompatibleAttributes, specifically it now rejects any combination of the disable form of the pragma and the numeric form (eg, vectorize(disable) and vectorize_width(N)). As a special case, it previously allowed this combination if the numeric value is 1. The logic seems cleaner without that special case. Lemme know if that's reasonable.
I'll be sending out a LLVM patch which consumes the generated metadata right after this.
The [size] on these arrays is superfluous? Also, Reid's suggestion makes sense if it ends up simplifying the code