Skip to content

Allow [[...]] attributes on loop statements#124

Merged
eyck merged 1 commit into
Minres:masterfrom
7FM:loop-attributes
Jul 22, 2026
Merged

Allow [[...]] attributes on loop statements#124
eyck merged 1 commit into
Minres:masterfrom
7FM:loop-attributes

Conversation

@7FM

@7FM 7FM commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Add an attributes slot to the while, for, and do-while loop rules so that [[name]] / [[name=expr]] / [[name(a, b)]] attributes can be attached to loops, matching the existing attachment points (functions, instructions, always-blocks, and declarators). This might be useful in the future to guide HLS with custom attributes, for example, a partial unrolling factor.

Add an attributes slot to the while, for and do-while loop rules so that
[[name]] / [[name=expr]] / [[name(a, b)]] attributes can be attached to
loops, matching the existing attachment points (functions, instructions,
always-blocks and declarators). Since all three loop rules declare the
same feature, it is hoisted onto the common LoopStatement supertype.

The analyzer validates them uniformly across all three loop forms via a
new `loop` AttributeUsage: attribute parameters are analyzed, unknown
names produce the usual warning, and attributes registered only for
other usages are rejected when placed on a loop.
@eyck
eyck merged commit be2c3cb into Minres:master Jul 22, 2026
1 check passed
@7FM
7FM deleted the loop-attributes branch July 22, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants