Please sign in to comment.
F18 DO CONCURRENT construct implementation (and a little more)
This is a full serial implementation of the F18 DO CONCURRENT construct, including locality specifications and associated constraints C1121-30, C1136-41, and C1166. There are also collateral feature implementations to upgrade FORALL statements and constructs and the EXIT statement to F08/F18 status. With this implementation, a loop such as: do concurrent (i=1:m, j=1:n, i.ne.j) local(a) local_init(b) shared(c) <body> enddo generates code that looks like: do i=1,m do j=1,n if (i.ne.j) b = b ! <construct b> = <host b> <body> endif enddo enddo In this code, variables a and b are local to each iteration of the loop nest. Variable c is shared across iterations and host routine code. F08/F18 DO CONCURRENT constructs and FORALL statements and constructs may specify an explicit index type: do concurrent (integer(8) :: i=1:m, j=1:n, i.ne.j) ! type of i, j forall (integer(2) :: i=1:6) a(i) = 1 ! type of i Although FORALL code generation is very different from DO CONCURRENT code generation, the two share this syntax, so FORALL code is also updated with this capability to full F08/F18 status. F08 syntax specified DO CONCURRENT loop control in terms of FORALL loop control. F18 syntax does the reverse (and puts FORALL on the path to deletion). Grammar productions here use DO CONCURRENT centric names. F18 constraint C1166 prohibits an EXIT statement from leaving a DO CONCURRENT construct. This constraint is implemented in code that is also upgraded to allow EXITs from non-loop constructs, as allowed in F08/F18.
- Loading branch information...
Showing with 1,238 additions and 653 deletions.
- +2 −3 include/flang/Error/errmsg-in.n
- +4 −3 tools/flang1/flang1exe/commopt.c
- +15 −0 tools/flang1/flang1exe/dtypeutl.c
- +22 −15 tools/flang1/flang1exe/kwddf.h
- +1 −3 tools/flang1/flang1exe/rest.c
- +77 −52 tools/flang1/flang1exe/scan.c
- +31 −78 tools/flang1/flang1exe/semant.c
- +67 −70 tools/flang1/flang1exe/semant.h
- +805 −267 tools/flang1/flang1exe/semant3.c
- +7 −8 tools/flang1/flang1exe/semantio.c
- +6 −36 tools/flang1/flang1exe/semsmp.c
- +146 −93 tools/flang1/flang1exe/semutil.c
- +4 −7 tools/flang1/flang1exe/semutil2.c
- +9 −0 tools/flang1/flang1exe/symutl.c
- +1 −0 tools/flang1/flang1exe/symutl.h
- +2 −1 tools/flang1/flang1exe/transfrm.c
- +3 −3 tools/flang1/flang1exe/vsub.c
- +3 −2 tools/flang1/utils/prstab/gram.tki
- +33 −12 tools/flang1/utils/prstab/gram.txt
Oops, something went wrong.