f18 icon indicating copy to clipboard operation
f18 copied to clipboard

[OpenMP] [RFC] Combined construct semantic checks duplicate code

Open DavidTruby opened this issue 5 years ago • 2 comments

When looking at implementing semantic cheks for the target combined constructs I noticed that for the existing combined constructs that have been implemented (e.g. parallel do) the clause checks from the constructs is just copied into the combined construct.

I'm wondering if there's a better way of doing this, for two reasons:

  1. There are a large number of combined constructs for target, so a lot of code is going to be duplicated here.
  2. If a new version of the OpenMP spec comes along and adds a new allowed clause e.g. for do, the only diff in the specs will be on that specific statement, but when implementing it someone would need to also remember to update parallel do, target teams distribute parallel do, do simd, etc etc

Ideally we'd just be able to fetch which clauses are allowed for another construct, so we can just add those for the combined constructs. I couldn't think of an easy way of implementing this without changing the structure of the code a lot though..

Does anyone have any ideas?

DavidTruby avatar Nov 15 '19 11:11 DavidTruby

@DavidTruby Would you like to move this discussion to the mailing list?

sscalpone avatar Dec 11 '19 17:12 sscalpone

@sscalpone I haven't had time to look at this recently, but it's something I think we have consensus on the mailing list that we should change. Perhaps we should change this ticket to reflect that it is something that we should do but haven't started yet?

DavidTruby avatar Dec 11 '19 17:12 DavidTruby