7 Commits

Author SHA1 Message Date
Johannes Doerfert
f3bfc56327
[Offload][OpenMP] Prettify error messages by "demangling" the kernel name (#101400)
The kernel names for OpenMP are manually mangled and not ideal when we
report something to the user. We demangle them now, providing the
function and line number of the target region, together with the actual
kernel name.
2024-08-01 15:24:15 -07:00
Krzysztof Parzyszek
d577518d98
[Frontend][OpenMP] Implement getLeafOrCompositeConstructs (#89104)
This function will break up a construct into constituent leaf and
composite constructs, e.g. if OMPD_c_d_e and OMPD_d_e are composite
constructs, then OMPD_a_b_c_d_e will be broken up into the list {OMPD_a,
OMPD_b, OMPD_c_d_e}.
2024-04-24 08:03:36 -05:00
Krzysztof Parzyszek
70d3ddb280
[Frontend][OpenMP] Add functions for checking construct type (#87258)
Implement helper functions to identify leaf, composite, and combined
constructs.
2024-04-23 08:10:40 -05:00
Krzysztof Parzyszek
b8ff08d0e6 [Frontend][OpenMP] Add missing "return" statement after 40137ff0d81be
When responding to review comments, `return {}` was accidentally replaced
by `std::nullptr` instead of `return std::nullptr`.
2024-04-22 15:35:42 -05:00
Krzysztof Parzyszek
40137ff0d8
[Frontend][OpenMP] Refactor getLeafConstructs, add getCompoundConstruct (#87247)
Emit a special leaf construct table in DirectiveEmitter.cpp, which will
allow both decomposition of a construct into leafs, and composition of
constituent constructs into a single compound construct (if possible).
The function `getLeafConstructs` is no longer auto-generated, but
implemented in OMP.cpp.

The table contains a row for each directive, and each row has the
following format
`dir_id, num_leafs, leaf1, leaf2, ..., leafN, -1, ...`
The rows are sorted lexicographically with respect to the leaf
constructs. This allows a binary search for the row corresponding to the
given list of leafs.

There is an auxiliary table that for each directive contains the index
of the row corresponding to that directive.

Looking up leaf constructs for a directive `dir_id` is of constant time,
and and consists of two lookups: `LeafTable[Auxiliary[dir_id]]`.
Finding a compound directive given the set of leafs is of time O(logn),
and is roughly represented by
`row = binary_search(LeafTable); return row[0]`.

The functions `getLeafConstructs` and `getCompoundConstruct` use these
lookup methods internally.
2024-04-22 14:41:11 -05:00
Krzysztof Parzyszek
141ebdd242
[Frontend][OpenMP] introduce OMP.h header file, use it instead of OMP… (#84188)
….h.inc

The consumers of OpenMP-related definitions include a TableGen-generated
file OMP.h.inc. Having a separate OMP.h allows putting additional
declarations in there that are not auto-generated.

This patch is NFC.
2024-03-08 07:21:42 -06:00
Valentin Clement
d709dcc090 [openacc][openmp] Reduce number of generated file and prefer inclusion of .inc
Follow up from D92955 and D83636. This patch makes the base cpp files
OMP.cpp and ACC.cpp normal files and they now include the XXX.inc file
generated by tablegen. This reduces the number of file generated by the
DirectiveEmitter backend and makes it closer to the proposal in D83636.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D93560
2021-03-23 09:16:53 -04:00