Skip to content

Commit 528c3ea

Browse files
committed
Minor changes to OpenMP offload utilities
1 parent 37300ff commit 528c3ea

File tree

1 file changed

+5
-52
lines changed

1 file changed

+5
-52
lines changed

tools/flang2/flang2exe/tgtutil.cpp

Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -140,47 +140,6 @@ ld_sptr(SPTR sptr)
140140
return ad3ili(IL_LD, ili, nme, mem_size(DTY(DTYPEG(sptr))));
141141
}
142142
}
143-
static char*
144-
getSPTRname(SPTR sptr){
145-
char* name;
146-
if(ST_CONST == STYPEG(sptr)) {
147-
NEW(name, char, 100);
148-
sprintf(name, "%d", CONVAL2G(sptr));
149-
return name;
150-
}
151-
return getprint(sptr);
152-
}
153-
static char*
154-
getILIname(int ili)
155-
{
156-
ILI_OP op = ilib.stg_base[ili].opc;
157-
char *name, *fname;
158-
switch(op)
159-
{
160-
case IL_ACON:
161-
case IL_ICON:
162-
return getSPTRname(ILI_SymOPND(ili, 1));
163-
case IL_DFRIR:
164-
name = getSPTRname(ILI_SymOPND((ILI_SymOPND(ili,1)),1));
165-
NEW(fname, char, strlen(name)+5);
166-
sprintf(fname,"%s()", name);
167-
return fname;
168-
case IL_LD:
169-
case IL_LDA:
170-
case IL_LD256:
171-
case IL_LDDCMPLX:
172-
case IL_LDDP:
173-
case IL_LDHP:
174-
case IL_LDKR:
175-
case IL_LDQ:
176-
case IL_LDQU:
177-
case IL_LDSP:
178-
return getSPTRname(NME_SYM(ILI_SymOPND(ili, 2)));
179-
default:
180-
return "[symbol name cannot be printed]";
181-
}
182-
return "[symbol name cannot be printed]";
183-
}
184143

185144
#define TGT_CHK(_api) \
186145
(((_api) > TGT_API_BAD && (_api) < TGT_API_N_ENTRIES) ? _api : TGT_API_BAD)
@@ -387,7 +346,6 @@ tgt_target_fill_params(SPTR arg_base_sptr, SPTR arg_size_sptr, SPTR args_sptr,
387346
SPTR args_maptypes_sptr, OMPACCEL_TINFO *targetinfo)
388347
{
389348
int i, j, ilix, iliy;
390-
char *name_base="", *name_length="";
391349
OMPACCEL_SYM midnum_sym;
392350
DTYPE param_dtype, load_dtype;
393351
SPTR param_sptr;
@@ -439,18 +397,14 @@ tgt_target_fill_params(SPTR arg_base_sptr, SPTR arg_size_sptr, SPTR args_sptr,
439397
else if (llis_pointer_kind(param_dtype))
440398
param_dtype = DTySeqTyElement(param_dtype);
441399
iliy = targetinfo->symbols[i].ili_base;
442-
ilix = mk_ompaccel_store(iliy, DT_ADDR, nme_base,
443-
ad_acon(arg_base_sptr, i * TARGET_PTRSIZE));
400+
ilix = mk_ompaccel_store(iliy, DT_ADDR, nme_base, ad_acon(arg_base_sptr, i * TARGET_PTRSIZE));
444401
/* Assign args */
445402
chk_block(ilix);
446-
ilix = ad1ili(IL_IKMV, targetinfo->symbols[i].ili_lowerbound);
447-
ilix = mk_ompaccel_mul(ilix, DT_INT8, ad_kconi(size_of(param_dtype)),
448-
DT_INT8);
449-
ilix = ad1ili(IL_KAMV, ilix);
403+
ilix = ikmove(targetinfo->symbols[i].ili_lowerbound);
404+
ilix = mk_ompaccel_mul(ilix, DT_INT8, ad_kconi(size_of(param_dtype)), DT_INT8);
405+
ilix = sel_aconv(ilix);
450406
ilix = mk_ompaccel_add(iliy, DT_ADDR, ilix, DT_INT8);
451-
ilix = mk_ompaccel_store(ilix, DT_ADDR, nme_args,
452-
ad_acon(args_sptr, i * TARGET_PTRSIZE));
453-
name_base = getILIname(targetinfo->symbols[i].ili_lowerbound);
407+
ilix = mk_ompaccel_store(ilix, DT_ADDR, nme_args, ad_acon(args_sptr, i * TARGET_PTRSIZE));
454408
chk_block(ilix);
455409
} else {
456410
/* Optimization - Pass by value for scalar */
@@ -472,7 +426,6 @@ tgt_target_fill_params(SPTR arg_base_sptr, SPTR arg_size_sptr, SPTR args_sptr,
472426
if(targetinfo->symbols[i].in_map) {
473427
ilix = ikmove(targetinfo->symbols[i].ili_length);
474428
ilix = mk_ompaccel_mul(ilix, DT_INT8, ad_kconi(size_of(param_dtype)), DT_INT8);
475-
name_length = getILIname(targetinfo->symbols[i].ili_length);
476429
} else {
477430
if(isMidnum)
478431
ilix = _tgt_target_fill_size(midnum_sym.host_sym, targetinfo->symbols[i].map_type);

0 commit comments

Comments
 (0)