bader created this revision.
bader added a reviewer: aaron.ballman.
Herald added a subscriber: ebevhan.
Herald added a project: All.
bader requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
There is a contradiction in the #pragma unroll behavior documentation.
It says that specifying `#pragma unroll` without a parameter directs the
loop unroller to attempt to partially unroll the loop if the trip count
is not known at compile time. At the same time later it states that
`#pragma unroll` has identical semantics to `#pragma clang loop
unroll(full)`, which doesn't attempt to unroll partially if the trip
count is not known at compile time.

If unroll(enable) is specified the unroller will attempt to fully unroll the 
loop if the trip count is known at compile time. If the fully unrolled code 
size is greater than an internal limit the loop will be partially unrolled up 
to this limit. If the trip count is not known at compile time the loop will be 
partially unrolled with a heuristically chosen unroll factor.

If unroll(full) is specified the unroller will attempt to fully unroll the loop 
if the trip count is known at compile time identically to unroll(enable). 
However, with unroll(full) the loop will not be unrolled if the loop count is 
not known at compile time.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136160

Files:
  clang/include/clang/Basic/AttrDocs.td


Index: clang/include/clang/Basic/AttrDocs.td
===================================================================
--- clang/include/clang/Basic/AttrDocs.td
+++ clang/include/clang/Basic/AttrDocs.td
@@ -3569,7 +3569,7 @@
   }
 
 ``#pragma unroll`` and ``#pragma unroll _value_`` have identical semantics to
-``#pragma clang loop unroll(full)`` and
+``#pragma clang loop unroll(enable)`` and
 ``#pragma clang loop unroll_count(_value_)`` respectively. ``#pragma nounroll``
 is equivalent to ``#pragma clang loop unroll(disable)``. See
 `language extensions


Index: clang/include/clang/Basic/AttrDocs.td
===================================================================
--- clang/include/clang/Basic/AttrDocs.td
+++ clang/include/clang/Basic/AttrDocs.td
@@ -3569,7 +3569,7 @@
   }
 
 ``#pragma unroll`` and ``#pragma unroll _value_`` have identical semantics to
-``#pragma clang loop unroll(full)`` and
+``#pragma clang loop unroll(enable)`` and
 ``#pragma clang loop unroll_count(_value_)`` respectively. ``#pragma nounroll``
 is equivalent to ``#pragma clang loop unroll(disable)``. See
 `language extensions
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to