Revision tags: llvmorg-21-init, llvmorg-19.1.7 |
|
#
be32621c |
| 09-Jan-2025 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Implement 'device' and 'host' clauses for 'update'
These two clauses just take a 'var-list' and specify where the variables should be copied from/to. This patch implements the AST nodes f
[OpenACC] Implement 'device' and 'host' clauses for 'update'
These two clauses just take a 'var-list' and specify where the variables should be copied from/to. This patch implements the AST nodes for them and ensures they properly take a var-list.
show more ...
|
#
2c2accbc |
| 08-Jan-2025 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Enable 'self' sema for 'update' construct
The 'self' clause is an unfortunately difficult one, as it has a significantly different meaning between 'update' and the other constructs. This
[OpenACC] Enable 'self' sema for 'update' construct
The 'self' clause is an unfortunately difficult one, as it has a significantly different meaning between 'update' and the other constructs. This patch introduces a way for the 'self' clause to work as both. I considered making this two separate AST nodes (one for 'self' on 'update' and one for the others), however this makes the automated macros/etc for supporting a clause break.
Instead, 'self' has the ability to act as either a condition or as a var-list clause. As this is the only one of its kind, it is implemented all within it. If in the future we have more that work like this, we should consider rewriting a lot of the macros that we use to make clauses work, and make them separate ast nodes.
show more ...
|
#
ff24e9a1 |
| 06-Jan-2025 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Implement 'default_async' sema
A fairly simple one, only valid on the 'set' construct, this clause takes an int expression. Most of the work was already done as a part of parsing, so this
[OpenACC] Implement 'default_async' sema
A fairly simple one, only valid on the 'set' construct, this clause takes an int expression. Most of the work was already done as a part of parsing, so this patch ends up being a lot of infrastructure.
show more ...
|
#
bdf25553 |
| 19-Dec-2024 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Implement 'device_num' clause sema for 'init'/'shutdown'
This is a very simple sema implementation, and just required AST node plus the existing diagnostics. This patch adds tests and add
[OpenACC] Implement 'device_num' clause sema for 'init'/'shutdown'
This is a very simple sema implementation, and just required AST node plus the existing diagnostics. This patch adds tests and adds the AST node required, plus enables it for 'init' and 'shutdown' (only!)
show more ...
|
#
4bbdb018 |
| 19-Dec-2024 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Implement 'init' and 'shutdown' constructs
These two constructs are very simple and similar, and only support 3 different clauses, two of which are already implemented. This patch adds AS
[OpenACC] Implement 'init' and 'shutdown' constructs
These two constructs are very simple and similar, and only support 3 different clauses, two of which are already implemented. This patch adds AST nodes for both constructs, and leaves the device_num clause unimplemented, but enables the other two.
show more ...
|
#
e34cc7c9 |
| 17-Dec-2024 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Implement 'wait' construct
The arguments to this are the same as for the 'wait' clause, so this reuses all of that infrastructure. So all this has to do is support a pair of clauses that a
[OpenACC] Implement 'wait' construct
The arguments to this are the same as for the 'wait' clause, so this reuses all of that infrastructure. So all this has to do is support a pair of clauses that are already implemented (if and async), plus create an AST node. This patch does so, and adds proper testing.
show more ...
|
Revision tags: llvmorg-19.1.6 |
|
#
bfc2dbe0 |
| 16-Dec-2024 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Implement data construct 'at least 1 of ... clauses' rule
All 4 of the 'data' constructs have a requirement that at least 1 of a small list of clauses must appear on the construct. This p
[OpenACC] Implement data construct 'at least 1 of ... clauses' rule
All 4 of the 'data' constructs have a requirement that at least 1 of a small list of clauses must appear on the construct. This patch implements that restriction, and updates all of the tests it takes to do so.
show more ...
|
#
fbb14dd9 |
| 16-Dec-2024 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Implement 'use_device' clause AST/Sema
This is a clause that is only valid on 'host_data' constructs, and identifies variables which it should use the current device address. From a Sema p
[OpenACC] Implement 'use_device' clause AST/Sema
This is a clause that is only valid on 'host_data' constructs, and identifies variables which it should use the current device address. From a Sema perspective, the only thing novel here is mild changes to how ActOnVar works for this clause, else this is very much like the rest of the 'var-list' clauses.
show more ...
|
#
1ab81f8e |
| 16-Dec-2024 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Implement 'delete' AST/Sema for 'exit data' construct
'delete' is another clause that has very little compile-time implication, but needs a full AST that takes a var list. This patch ipml
[OpenACC] Implement 'delete' AST/Sema for 'exit data' construct
'delete' is another clause that has very little compile-time implication, but needs a full AST that takes a var list. This patch ipmlements it fully, plus adds sufficient test coverage.
show more ...
|
#
3351b3bf |
| 13-Dec-2024 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] implement 'detach' clause sema
This is another new clause specific to 'exit data' that takes a pointer argument. This patch implements this the same way we do a few other clauses (like att
[OpenACC] implement 'detach' clause sema
This is another new clause specific to 'exit data' that takes a pointer argument. This patch implements this the same way we do a few other clauses (like attach) that have the same restrictions.
show more ...
|
#
010d0115 |
| 10-Dec-2024 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Create AST nodes for 'data' constructs
These constructs are all very similar and closely related, so this patch creates the AST nodes for them, serialization, printing/etc. Additionally th
[OpenACC] Create AST nodes for 'data' constructs
These constructs are all very similar and closely related, so this patch creates the AST nodes for them, serialization, printing/etc. Additionally the restrictions are all added as tests/todos in the tests, as those will have to be implemented once we get those clauses implemented.
show more ...
|
#
ee090cb8 |
| 11-Dec-2024 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Treat 'delete' as a valid clause during parsing in C++ mode
This didn't end up being properly tested, but 'delete' as a keyword causes us to not properly recognize it as a clause kind. Th
[OpenACC] Treat 'delete' as a valid clause during parsing in C++ mode
This didn't end up being properly tested, but 'delete' as a keyword causes us to not properly recognize it as a clause kind. This patch correctly adds the work to make sure it is recognized correctly.
show more ...
|
Revision tags: llvmorg-19.1.5, llvmorg-19.1.4 |
|
#
834dfd23 |
| 18-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[Parse] Remove ParseDiagnostic.h (#116496)
This patch removes clang/Parse/ParseDiagnostic.h because it just
forwards to clang/Basic/DiagnosticParse.h.
|
#
39351f8e |
| 07-Nov-2024 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Implement AST/Sema for combined constructs
Combined constructs (OpenACC 3.3 section 2.11) are a short-cut for writing a `loop` construct immediately inside of a `compute` construct. Howeve
[OpenACC] Implement AST/Sema for combined constructs
Combined constructs (OpenACC 3.3 section 2.11) are a short-cut for writing a `loop` construct immediately inside of a `compute` construct. However, this interaction requires we do additional work to ensure that we get the semantics between the two correct, as well as diagnostics.
This patch adds the semantic analysis for the constructs (but no clauses), as well as the AST nodes.
show more ...
|
#
b0cfbfd7 |
| 08-Nov-2024 |
Erich Keane <ekeane@nvidia.com> |
[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, p
[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.
show more ...
|
Revision tags: llvmorg-19.1.3, llvmorg-19.1.2 |
|
#
cf456ed2 |
| 14-Oct-2024 |
Erich Keane <ekeane@nvidia.com> |
[OpenACC] implement loop 'worker' clause. (#112206)
The worker clause specifies iterations of the loop/ that are executed in
parallel by distributing the iterations among the multiple works within
[OpenACC] implement loop 'worker' clause. (#112206)
The worker clause specifies iterations of the loop/ that are executed in
parallel by distributing the iterations among the multiple works within
a single gang.
The sema rules for this type are simply that it cannot be combined with
a `kernel` construct with a `num_workers` clause, child `loop` clauses
cannot contain a `gang` or `worker` clause, and that the argument is oly
allowed when associated with a `kernel`.
show more ...
|
#
5b25c313 |
| 11-Oct-2024 |
Erich Keane <ekeane@nvidia.com> |
[OpenACC] Implement loop 'gang' clause. (#112006)
The 'gang' clause is used to specify parallel execution of loops, thus
has some complicated rules depending on the 'loop's associated compute
cons
[OpenACC] Implement loop 'gang' clause. (#112006)
The 'gang' clause is used to specify parallel execution of loops, thus
has some complicated rules depending on the 'loop's associated compute
construct. This patch implements all of those.
show more ...
|
#
d412cea8 |
| 03-Oct-2024 |
Erich Keane <ekeane@nvidia.com> |
[OpenACC] Implement 'tile' attribute AST (#110999)
The 'tile' clause shares quite a bit of the rules with 'collapse', so a
followup patch will add those tests/behaviors. This patch deals with
addi
[OpenACC] Implement 'tile' attribute AST (#110999)
The 'tile' clause shares quite a bit of the rules with 'collapse', so a
followup patch will add those tests/behaviors. This patch deals with
adding the AST node.
The 'tile' clause takes a series of integer constant expressions, or *.
The asterisk is now represented by a new OpenACCAsteriskSizeExpr node,
else this clause is very similar to others.
show more ...
|
#
da4b972e |
| 02-Oct-2024 |
Erich Keane <ekeane@nvidia.com> |
[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 rang
[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.
show more ...
|
#
97da34e0 |
| 01-Oct-2024 |
Erich Keane <ekeane@nvidia.com> |
[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
[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.
show more ...
|
Revision tags: llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7 |
|
#
2b939e18 |
| 31-May-2024 |
erichkeane <ekeane@nvidia.com> |
[OpenACC] Implement auto/seq/independent clause Sema for 'loop'
These three clauses are all quite trivial, as they take no parameters. They are mutually exclusive, and 'seq' has some other exclusive
[OpenACC] Implement auto/seq/independent clause Sema for 'loop'
These three clauses are all quite trivial, as they take no parameters. They are mutually exclusive, and 'seq' has some other exclusives that are implemented here.
The ONE thing that isn't implemented is 2.9's restriction (line 2010): 'A loop associated with a 'loop' construct that does not have a 'seq' clause must be written to meet all the following conditions'.
Future clauses will require similar work, so it'll be done as a followup.
show more ...
|
#
42f4e505 |
| 05-Jun-2024 |
Erich Keane <ekeane@nvidia.com> |
[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
con
[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).
show more ...
|
#
193e9007 |
| 28-May-2024 |
erichkeane <ekeane@nvidia.com> |
[OpenACC][NFC] Fix begin loc and split it from the directive location
I discovered while working on something else that we were using the location of the directive name as the 'beginloc' which cause
[OpenACC][NFC] Fix begin loc and split it from the directive location
I discovered while working on something else that we were using the location of the directive name as the 'beginloc' which caused some problems in a few places. This patch makes it so our beginloc is the '#' as we originally designed, and then adds a DirectiveLoc concept to a construct for use diagnosing the name.
show more ...
|
#
a15b685c |
| 21-May-2024 |
Erich Keane <ekeane@nvidia.com> |
[OpenACC] Implement 'reduction' sema for compute constructs (#92808)
'reduction' has a few restrictions over normal 'var-list' clauses:
1- On parallel, a num_gangs can only have 1 argument when c
[OpenACC] Implement 'reduction' sema for compute constructs (#92808)
'reduction' has a few restrictions over normal 'var-list' clauses:
1- On parallel, a num_gangs can only have 1 argument when combined with
reduction. These two aren't able to be combined on any other of the
compute constructs however.
2- The vars all must be 'numerical data types' types of some sort, or a
'composite of numerical data types'. A list of types is given in the
standard as a minimum, so we choose 'isScalar', which covers all of
these types and keeps types that are actually numeric. Other compilers
don't seem to implement the 'composite of numerical data types', though
we do.
3- Because of the above restrictions, member-of-composite is not
allowed, so any access via a memberexpr is disallowed. Array-element and
sub-arrays (aka array sections) are both permitted, so long as they meet
the requirements of #2.
This patch implements all of these for compute constructs.
show more ...
|
Revision tags: llvmorg-18.1.6 |
|
#
8ef2011b |
| 13-May-2024 |
erichkeane <ekeane@nvidia.com> |
Reapply "[OpenACC] device_type clause Sema for Compute constructs"
device_type, also spelled as dtype, specifies the applicability of the clauses following it, and takes a series of identifiers repr
Reapply "[OpenACC] device_type clause Sema for Compute constructs"
device_type, also spelled as dtype, specifies the applicability of the clauses following it, and takes a series of identifiers representing the architectures it applies to. As we don't have a source for the valid architectures yet, this patch just accepts all.
Semantically, this also limits the list of clauses that can be applied after the device_type, so this implements that as well.
This reverts commit 06f04b2e27f2586d3db2204ed4e54f8b78fea74e. This reapplies commit c4a9a374749deb5f2a932a7d4ef9321be1b2ae5d. The build failures were caused by the patch depending on the order of evaluation of arguments to a function. This reapplication separates out the capture of one of the values.
show more ...
|