4 Commits

Author SHA1 Message Date
Erich Keane
4f82f27ccd
[OpenACC] 'collapse' clause 'force' tag (#110906)
The 'force' tag permits intervening code on the applicable 'loop'
construct,
 so this implements the restriction when the 'force' tag isn't present.
2024-10-03 06:07:39 -07:00
Erich Keane
5e92bfe97f
[OpenACC] Check Loop counts for 'collapse' clause. (#110851)
OpenACC Spec requires that each loop associated with a 'collapse' have
exactly 1 loop/nest. This is implemented in 2 parts: 1- diagnosing when
we see a 2nd loop at any level with an applicable 'collapse'
2- Diagnosing if we didn't see enough 'depth' of loops.

Other loops (non-for) are diagnosed by a previous patch, and other
intervening code will be diagnosed in a followup.
2024-10-02 10:33:49 -07:00
Erich Keane
da4b972ef6
[OpenACC] Enforce all 'collapse' intervening rules (#110684)
'collapse' makes the 'loop' construct apply to the next N nested loops,
and 'loop' requires all associated loops be 'for' loops (or range-for).

This patch adds this restriction, plus adds a number of infrastructure
changes to permit some of the other restrictions in the future to be
implemented.

'collapse' also requires that there is not any calls to other directives
 inside of the collapse region, so this also implements that limitation.
2024-10-02 07:10:53 -07:00
Erich Keane
97da34e015
[OpenACC] Add 'collapse' clause AST/basic Sema implementation (#109461)
The 'collapse' clause on a 'loop' construct is used to specify how many
nested loops are associated with the 'loop' construct. It takes an
optional 'force' tag, and an integer constant expression as arguments.

There are many other restrictions based on the contents of the loop/etc,
but those are implemented in followup patches, for now, this patch just
adds the AST node and does basic argument checking on the loop-count.
2024-10-01 06:40:21 -07:00