public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/3] OpenMP: Improve data abstractions for context selectors
@ 2023-11-19  9:21 Sandra Loosemore
  2023-11-19  9:21 ` [PATCH 1/3] OpenMP: Introduce accessor macros and constructors " Sandra Loosemore
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Sandra Loosemore @ 2023-11-19  9:21 UTC (permalink / raw)
  To: gcc-patches; +Cc: jakub, tobias

While trying to track down some bugs in the metadirective patches
(currently on the OG13 branch), I found that I was getting totally
lost in the undocumented data structures for context selectors; the
multiple levels of TREE_PURPOSE and TREE_VALUE that don't hint at what
kind of object is being accessed, generic variable names like "t1" and
"t2" likewise.  Similarly the inconsistent and undocumented
representation of different properties, switch statements over the
first character of the trait selector set name, etc added to my
confusion.  It's not surprising that adding new features made this
foundation pretty creaky and I think that adding the additional
selector features in OMP 5.2 and 6.* is going to cause it to fall over
completely.

This series of patches adds a layer of data abstraction, using at
least slightly more descriptive names, and then tries to address some
of the representation and coding issues.

Part 1 introduces some macros (e.g., OMP_TSS_ID instead of
TREE_PURPOSE to get the name of a selector) and renames a bunch of
variables (e.g., tss for a trait-set selector, ts for a trait
selector, tp for a trait property).  Those changes were relatively
mechanical.  I also added some abstraction for the trait-score so that
it need not be handled explicitly when processing property lists.

Part 2 changes the representation of name-list properties so that both
the string and identifier forms store the name in the same place.

Part 3 is a more radical change: it replaces the string names of
trait-set and trait selectors with enumerators, which allows clean-up
of those funky switch statements.  I also made things more
table-driven.  Alas, this part is still WIP; there's an ICE in one of
the test cases I haven't been able to track down yet.

I can continue to work on this patch set in the next couple of weeks
if the general direction is seen as a good thing.  I believe there is
a little more latitude re the end of stage 1 with OpenMP (as there is
with target-specific patches) since it is not enabled by default; in any
case I'd like to get feedback on the general direction before continuing too
much farther with this, and adapting the metadirective patches to match it.

-Sandra

Sandra Loosemore (3):
  OpenMP: Introduce accessor macros and constructors for context
    selectors.
  OpenMP: Unify representation of name-list properties.
  OpenMP: Use enumerators for names of trait-sets and traits

 gcc/c/c-parser.cc           | 212 ++++-------
 gcc/cp/decl.cc              |   8 +-
 gcc/cp/parser.cc            | 212 ++++-------
 gcc/cp/pt.cc                |  93 +++--
 gcc/fortran/trans-openmp.cc |  65 +++-
 gcc/gimplify.cc             |   4 +-
 gcc/omp-general.cc          | 713 ++++++++++++++++++++++--------------
 gcc/omp-general.h           | 132 ++++++-
 8 files changed, 811 insertions(+), 628 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-11-27 18:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-19  9:21 [PATCH 0/3] OpenMP: Improve data abstractions for context selectors Sandra Loosemore
2023-11-19  9:21 ` [PATCH 1/3] OpenMP: Introduce accessor macros and constructors " Sandra Loosemore
2023-11-19  9:21 ` [PATCH 2/3] OpenMP: Unify representation of name-list properties Sandra Loosemore
2023-11-19  9:21 ` [PATCH 3/3] OpenMP: Use enumerators for names of trait-sets and traits Sandra Loosemore
2023-11-21 20:48   ` Sandra Loosemore
2023-11-20 10:32 ` [PATCH 0/3] OpenMP: Improve data abstractions for context selectors Julian Brown
2023-11-22 16:22 ` [PATCH V2 3/3] OpenMP: Use enumerators for names of trait-sets and traits Sandra Loosemore
2023-11-27 17:19   ` Tobias Burnus
2023-11-27 18:18     ` Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).