[clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 1 10:18:13 PDT 2023
================
@@ -7416,3 +7416,46 @@ that ``p->array`` must have at least ``p->count`` number of elements available:
}];
}
+
+def CodeAlignAttrDocs : Documentation {
+ let Category = DocCatVariable;
+ let Heading = "clang::code_align";
+ let Content = [{
+The ``clang::code_align(N)`` attribute applies to a loop and it specifies the
+byte alignment for a loop. The attribute accepts a positive integer constant
+initialization expression indicating the number of bytes for the minimum
+alignment boundary. Its value must be a power of 2, between 1 and 4096, such as
+1, 2, 4, 8, and so on. This attribute sets ``llvm.loop.align`` loop metadata
+when it applies on a loop statement.
----------------
erichkeane wrote:
Also, what guarantees does this make? Is this a hint, or a requirement? Are there situations where it cannot be applied correctly?
https://github.com/llvm/llvm-project/pull/70762
More information about the cfe-commits
mailing list