4 Commits

Author SHA1 Message Date
erichkeane
e27fe2e07c [OpenACC][NFC] Add the _Pragma spelling to a bunch of the tests
OpenACC PR 475(targetting OpenACC3.4) added support for the _Pragma
spelling of an OpenACC pragma. We already implemented this, as clang
doesn't really differentiate between the spellings (so we did it as an
inadvertent extension).

This patch adds a few spot-check tests to make sure we support this
spelling and that it results in the same AST as the traditional
spelling.
2025-03-12 11:01:38 -07:00
erichkeane
e4d57d6a72 [OpenACC] Remove 'loop' link to parent construct
After implementing 'loop', we determined that the link to its parent
only ever uses the type, not the construct itself. This patch removes
it, as it is both a waste and causes problems with serialization.
2024-11-08 10:23:04 -08:00
Erich Keane
b0cfbfd74b
[OpenACC] Implement loop restrictions on for loops. (#115370)
OpenACC restricts the contents of a 'for' loop affected by a 'loop'
construct without a 'seq'. The loop variable must be integer, pointer,
or random-access-iterator, it must monotonically increase/decrease, and
the trip count must be computable at runtime before the function.

This patch tries to implement some of these limitations to the best of
our ability, though it causes us to be perhaps overly restrictive at the
moment. I expect we'll revisit some of these rules/add additional
supported forms of loop-variable and 'monotonically increasing' here,
but the currently enforced rules are heavily inspired by the OMP
implementation here.
2024-11-08 05:49:45 -08:00
Erich Keane
42f4e505a3
[OpenACC] Loop construct basic Sema and AST work (#93742)
This patch implements the 'loop' construct AST, as well as the basic
appertainment rule. Additionally, it sets up the 'parent' compute
construct, which is necessary for codegen/other diagnostics.

A 'loop' can apply to a for or range-for loop, otherwise it has no other
restrictions (though some of its clauses do).
2024-06-05 06:21:48 -07:00