Skip to content

Commit ab7f15a

Browse files
authored
Merge pull request #635 from ThePortlandGroup/nv_stage
Pull 2018-12-12T13-57 Recent NVIDIA Changes
2 parents 5d9aa3d + f1ec0ff commit ab7f15a

File tree

15 files changed

+97
-31
lines changed

15 files changed

+97
-31
lines changed

include/flang/Error/errmsg-in.n

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,9 +1508,11 @@ A DO CONCURRENT or FORALL construct or statement may not specify an index name m
15081508
.MS S 1059 "The definition of subprogram $ does not have the same number of arguments as its declaration"
15091509
.MS S 1060 "The $ of the definition and declaration of subprogram $ must match"
15101510
.MS S 1061 "The definition of function return type of $ does not match its declaration type"
1511+
.MS S 1062 "LOCAL_INIT variable does not have an outside variable of the same name - $"
1512+
A DO CONCURRENT variable with LOCAL_INIT locality must have a host variable of the same name.
15111513
.MS S 1200 "OpenMP GPU - [$] is used, it is not implemented yet."
15121514
.MS S 1201 "OpenMP GPU - [$] is used with [$], this usage is not implemented yet."
15131515
.MS S 1202 "OpenMP GPU - [$] is used independently than [$], this usage is not implemented yet."
15141516
.MS S 1203 "OpenMP GPU - Directive target exit data is used, map type [$] cannot be used. It should be one of 'from', 'release', or 'delete'"
15151517
.MS S 1204 "OpenMP GPU - Directive target data is used, map type [$] cannot be used. It should be one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'"
1516-
.MS S 1205 "OpenMP GPU - Directive target enter data is used, map type [$] cannot be used. It should be one of 'to', or 'alloc'"
1518+
.MS S 1205 "OpenMP GPU - Directive target enter data is used, map type [$] cannot be used. It should be one of 'to', or 'alloc'"

runtime/flang/ieee_arithmetic.s

Whitespace-only changes.

runtime/flang/ieee_exceptions.s

Whitespace-only changes.

tools/flang1/flang1exe/outconv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static void
308308
convert_omp_workshare(void)
309309
{
310310
int std;
311-
int newstd;
311+
int newstd = 0;
312312
int ast;
313313
int lsptr;
314314
int prevast;
@@ -508,7 +508,8 @@ convert_omp_workshare(void)
508508
}
509509
break;
510510
}
511-
STD_PAR(newstd) = 1;
511+
if (newstd)
512+
STD_PAR(newstd) = 1;
512513

513514
break;
514515
case IN_CRITICAL:

tools/flang1/flang1exe/semant.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,7 +2270,11 @@ semant1(int rednum, SST *top)
22702270
sptr = insert_sym(sptr);
22712271

22722272
} else if (STYPEG(sptr) == ST_PROC && IN_MODULE_SPEC &&
2273-
get_seen_contains() && !sem.which_pass) {
2273+
get_seen_contains() && !sem.which_pass &&
2274+
/* separate module procedure is allowed to be declared &
2275+
defined within the same module
2276+
*/
2277+
!IS_INTERFACEG(sptr)) {
22742278
LOGICAL err = TYPDG(sptr) && SCOPEG(sptr) != stb.curr_scope;
22752279
if (!err) {
22762280
int dpdsc = 0;
@@ -14028,7 +14032,8 @@ _do_iface(int iface_state, int i)
1402814032
goto iface_err;
1402914033
}
1403014034
}
14031-
return;
14035+
if (proc <= NOSYM)
14036+
return;
1403214037
}
1403314038
if (strcmp(SYMNAME(iface), name) != 0)
1403414039
iface = getsymbol(name);

tools/flang1/flang1exe/semant3.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3046,6 +3046,7 @@ semant3(int rednum, SST *top)
30463046
DI_CONC_SYMAVL(doif) = sem.doconcurrent_symavl;
30473047
DI_CONC_BLOCK_SYM(doif) = sptr =
30483048
getccsym('b', sem.blksymnum++, ST_BLOCK);
3049+
CCSYMP(sptr, true);
30493050
STARTLINEP(sptr, gbl.lineno);
30503051
// If the do concurrent loop is nested in another do concurrent loop,
30513052
// the outer loop is the parent of the block sym. Otherwise, the
@@ -3405,14 +3406,22 @@ semant3(int rednum, SST *top)
34053406
}
34063407
break;
34073408
}
3409+
DCLCHK(sptr);
34083410
switch (DI_CONC_KIND(doif)) {
3409-
case TK_LOCAL:
34103411
case TK_LOCAL_INIT:
3412+
if (sptr >= DI_CONC_SYMAVL(doif)) {
3413+
error(1062, ERR_Severe, gbl.lineno, SYMNAME(sptr), CNULL);
3414+
DI_CONC_ERROR_SYMS(doif) = add_symitem(sptr, DI_CONC_ERROR_SYMS(doif));
3415+
break;
3416+
}
3417+
// fall through
3418+
case TK_LOCAL:
34113419
if (sptr < DI_CONC_SYMAVL(doif)) {
34123420
// sptr is external to the loop; get a construct instance.
34133421
if (STYPEG(sptr) == ST_PD) {
3422+
int dcld = DCLDG(sptr);
34143423
sptr = insert_sym(sptr);
3415-
DCLDP(sptr, 1);
3424+
DCLDP(sptr, dcld);
34163425
} else {
34173426
sptr = insert_dup_sym(sptr);
34183427
}

tools/flang1/flang1exe/semfunc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,10 @@ func_call2(SST *stktop, ITEM *list, int flag)
947947

948948
SST_ASTP(sp, new_ast);
949949
SST_IDP(sp, S_EXPR);
950+
} else if (A_TYPEG(ARGT_ARG(A_ARGSG(SST_ASTG(sp)), 0)) != A_ID) {
951+
// Inlining has problems with an expression in this context.
952+
// Downstream code can always handle simple variables.
953+
(void)tempify(sp);
950954
}
951955
/* else
952956
* iso_c_loc by reference pointer to pointer */

tools/flang1/flang1exe/semutil.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,7 @@ mklvalue(SST *stkptr, int stmt_type)
13071307
sptr = insert_sym(sptr);
13081308
DTYPEP(sptr, dtype);
13091309
DCLDP(sptr, dcld);
1310+
DCLCHK(sptr);
13101311
} else if (stmt_type == 5) {
13111312
int doif = sem.doif_depth;
13121313
dtype = DI_FORALL_DTYPE(doif) ? DI_FORALL_DTYPE(doif) : DTYPEG(sptr);
@@ -1315,6 +1316,7 @@ mklvalue(SST *stkptr, int stmt_type)
13151316
sptr = insert_sym(sptr);
13161317
DTYPEP(sptr, dtype);
13171318
DCLDP(sptr, dcld);
1319+
DCLCHK(sptr);
13181320
}
13191321

13201322
switch (STYPEG(sptr)) {
@@ -5824,17 +5826,21 @@ do_end(DOINFO *doinfo)
58245826
block_sptr = DI_CONC_BLOCK_SYM(orig_doif);
58255827
ENDLINEP(block_sptr, gbl.lineno);
58265828
ENDLABP(block_sptr, lab);
5827-
sptr = DI_CONC_SYMAVL(orig_doif);
5828-
for (i = DI_CONC_COUNT(orig_doif); i; --i, ++sptr)
5829+
for (i = DI_CONC_COUNT(orig_doif), symi = DI_CONC_SYMS(orig_doif); i;
5830+
--i, symi = SYMI_NEXT(symi)) {
5831+
sptr = SYMI_SPTR(symi);
58295832
HIDDENP(sptr, 1); // do concurrent index construct var
5830-
for (; sptr < stb.stg_avail; ++sptr)
5833+
}
5834+
for (++sptr; sptr < stb.stg_avail; ++sptr)
58315835
switch (STYPEG(sptr)) {
58325836
case ST_UNKNOWN:
58335837
case ST_IDENT:
58345838
case ST_VAR:
58355839
case ST_ARRAY:
58365840
if (SAVEG(sptr))
58375841
break;
5842+
if (!CCSYMG(sptr) && !HCCSYMG(sptr))
5843+
DCLCHK(sptr);
58385844
HIDDENP(sptr, 1); // do concurrent non-index construct var
58395845
if (ENCLFUNCG(sptr) == 0)
58405846
ENCLFUNCP(sptr, block_sptr);

tools/flang1/flang1exe/semutil2.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,6 +2668,9 @@ _constructf90(int base_id, int in_indexast, bool in_array, ACL *aclp)
26682668
for (; mem_sptr != NOSYM; mem_sptr = SYMLKG(mem_sptr)) {
26692669
if (!is_unl_poly(mem_sptr) && no_data_components(DTYPEG(mem_sptr)))
26702670
continue;
2671+
/* skip $td */
2672+
if (CLASSG(mem_sptr) && DESCARRAYG(mem_sptr))
2673+
continue;
26712674
if (XBIT(58, 0x10000) && POINTERG(mem_sptr) && !F90POINTERG(mem_sptr)) {
26722675
SST *astkp;
26732676
int aast;

tools/flang2/docs/xflag.n

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5239,6 +5239,8 @@ Print array assignments using pointer arithmetic always.
52395239
Don't demote address KMUL operations
52405240
.XB 0x200000:
52415241
in LLVM output, don't output the instruction info (lilix index, opcode)
5242+
.XB 0x400000:
5243+
reserved
52425244

52435245
.XF "202:"
52445246
Set number of bigbuffers for multi-buffer memory management for AMD GPU.

0 commit comments

Comments
 (0)