Skip to content

Commit

Permalink
Merge branch 'aomp-epsdb' into aomp-epsdb-mainline
Browse files Browse the repository at this point in the history
Change-Id: I56a610d003a852b844a94936b58e20865a99ebd6
  • Loading branch information
ronlieb committed Oct 3, 2022
2 parents aafd2cc + cbed49f commit ca75516
Show file tree
Hide file tree
Showing 20 changed files with 376 additions and 61 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ else()
set(FLANG_HAS_VERSION_PATCHLEVEL 0)
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcommon -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-enum-constexpr-conversion -Wno-incompatible-function-pointer-types")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcommon -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-enum-constexpr-conversion -Wno-incompatible-function-pointer-types -w")

# Add appropriate flags for GCC
if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -g -DOMP_OFFLOAD_LLVM -Wno-implicit-function-declaration -Wno-implicit-int -Wno-enum-constexpr-conversion -Wno-incompatible-function-pointer-types")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -g -DOMP_OFFLOAD_LLVM -Wno-implicit-function-declaration -Wno-implicit-int -Wno-enum-constexpr-conversion -Wno-incompatible-function-pointer-types -w")
option(WITH_WERROR "Compile with '-Werror' C compiler flag" ON)
if (WITH_WERROR)
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
Expand Down
2 changes: 2 additions & 0 deletions runtime/flangrti/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ enable_language(C ASM) # Enable assembly
SET(ASM_OPTIONS "-DLINUX_ELF")
SET(CMAKE_ASM_FLAGS "${CFLAGS} ${ASM_OPTIONS}" )

SET(CFLAGS, "${CFLAGS} -w")

if( ${TARGET_ARCHITECTURE} STREQUAL "x86_64" )
set(ARCH_DEP_FILES
x86_64-Linux/x86_daz.c
Expand Down
2 changes: 2 additions & 0 deletions runtime/libpgmath/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND ${LIBPGMATH_SYSTEM_PROCESSOR} MATCHES
string(REPLACE "-std=c++11" "-std=gnu++11" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
endif()

SET(CMAKE_CFLAGS, "${CMAKE_C_CFLAGS} -w")

# Needs to be changed to support cross-compilation
include(GetHostTriple)
get_host_triple(LIBPGMATH_HOST_TRIPLE)
Expand Down
4 changes: 2 additions & 2 deletions runtime/libpgmath/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ if(${LIBPGMATH_SYSTEM_PROCESSOR} MATCHES "x86_64" AND NOT ${LIBPGMATH_WITH_GENER
HOST_LINUX LINUX LINUX86 LINUX8664 MAXCPUS=256 MAXCPUSL=8 MAXCPUSR=8
TARGET_LINUX TARGET_LINUX_X86 TARGET_LINUX_X8664 TARGET_X86 TARGET_X8664
__gnu_linux__ PG_PIC)
set(FLAGS_L1 "-m64 -O3 ")
set(FLAGS_L1 "-m64 -O3 -w ")

set(DEFINITIONS_L2
LINUX LINUX86 LINUX8664 MAXCPUS=256 MAXCPUSL=8 MAXCPUSR=8 __gnu_linux__
TARGET_LINUX TARGET_LINUX_X86 TARGET_LINUX_X8664 TARGET_X86 TARGET_X8664
PG_PIC)
set(FLAGS_L2 "-m64 -O3 -mtune=core-avx2 -march=core-avx2 ")
set(FLAGS_L2 "-m64 -O3 -mtune=core-avx2 -march=core-avx2 -w ")

# common
# Definitions and compiler flags for level 1 directories
Expand Down
2 changes: 2 additions & 0 deletions tools/flang1/flang1exe/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -6223,6 +6223,8 @@ ast_trav_recurse(int ast, int *extra_arg)
case A_MP_EPDO:
case A_MP_BORDERED:
case A_MP_EORDERED:
case A_MP_LOOP:
case A_MP_ELOOP:
break;
case A_PREFETCH:
#if DEBUG
Expand Down
5 changes: 5 additions & 0 deletions tools/flang1/flang1exe/func.c
Original file line number Diff line number Diff line change
Expand Up @@ -4573,6 +4573,11 @@ rewrite_calls(void)
case A_MP_USE_DEVICE_PTR: // AOCC
case A_MP_IS_DEVICE_PTR: // AOCC
case A_MP_USE_DEVICE_ADDR: // AOCC
case A_MP_LOOP: // AOCC
case A_MP_ELOOP: // AOCC
case A_ID: // AOCC
case A_SUBSCR: // AOCC
case A_BINOP: // AOCC
break;
default:
interr("rewrite_subroutine: unknown stmt found", ast, 4);
Expand Down
11 changes: 11 additions & 0 deletions tools/flang1/flang1exe/kwddf.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ static KWORD t6[] = {
{"enddo", TK_MP_ENDPDO},
{"enddosimd", TK_MP_ENDDOSIMD},
{"endmaster", TK_MP_ENDMASTER},
{"endmetadirective", TK_MP_ENDMETADIR}, // AOCC
{"endordered", TK_MP_ENDORDERED},
{"endparallel", TK_MP_ENDPARALLEL},
{"endparalleldo", TK_MP_ENDPARDO},
Expand Down Expand Up @@ -476,9 +477,11 @@ static KWORD t6[] = {
{"endworkshare", TK_MP_ENDWORKSHARE},
{"flush", TK_MP_FLUSH},
{"master", TK_MP_MASTER},
{"metadirective", TK_MP_METADIR}, // AOCC
{"ordered", TK_MP_ORDERED},
{"parallel", TK_MP_PARALLEL},
{"paralleldo", TK_MP_PARDO},
{"loop", TK_MP_LOOP},
{"paralleldosimd", TK_MP_PARDOSIMD},
{"parallelsections", TK_MP_PARSECTIONS},
{"parallelworkshare", TK_MP_PARWORKSHR},
Expand Down Expand Up @@ -556,6 +559,13 @@ static KWORD t12[] = {
{"", 0}, /* a keyword index must be nonzero */
{"compare", TK_PGICOMPARE},
};
static KWORD t13[] = {
{"", 0}, /* a keyword index must be nonzero */
{"condition", TK_CONDITION},
{"default", TK_DEFAULT},
{"user", TK_USER},
{"when", TK_WHEN},
};

/* **** NOTE -- each of these must appear in a call to init_ktable() in
* scan_init().
Expand All @@ -571,6 +581,7 @@ static KTABLE pragma_kw = {sizeof(t8) / sizeof(KWORD), &t8[0]};
static KTABLE ppragma_kw = {sizeof(t9) / sizeof(KWORD), &t9[0]};
static KTABLE kernel_kw = {sizeof(t11) / sizeof(KWORD), &t11[0]};
static KTABLE pgi_kw = {sizeof(t12) / sizeof(KWORD), &t12[0]};
static KTABLE meta_kw = {sizeof(t13) / sizeof(KWORD), &t13[0]};

/* char classification macros */

Expand Down
2 changes: 1 addition & 1 deletion tools/flang1/flang1exe/lowerexp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5096,7 +5096,7 @@ lower_intrinsic(int ast)
return ilm;
} /* lower_intrinsic */

#if AST_MAX != 171 // AOCC - 169 + 1 + 1
#if AST_MAX != 173 // AOCC - 169 + 1 + 1
#error "Need to edit lowerexp.c to add or delete A_... AST types"
#endif

Expand Down
15 changes: 11 additions & 4 deletions tools/flang1/flang1exe/lowerilm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ handle_arguments(int ast, int symfunc, int via_ptr)
#endif

if (CLASSG(tbp_bind) && VTOFFG(tbp_bind) &&
(INVOBJG(tbp_bind) /* || NOPASSG(tbp_mem) */)) { /* NOPASS needs fixing */
(INVOBJG(tbp_bind) || NOPASSG(tbp_mem))) { /* NOPASS needs fixing */
via_tbp = 1;
if (NOPASSG(tbp_mem)) {
tbp_nopass_arg = pass_sym_of_ast(A_LOPG(ast));
Expand All @@ -1041,9 +1041,6 @@ handle_arguments(int ast, int symfunc, int via_ptr)
} else {
via_tbp = 0;
}
if (A_INVOKING_DESCG(ast) && (SCG(sym_of_ast(A_INVOKING_DESCG(ast))) == SC_PRIVATE)) {
via_tbp = 0;
}

count = A_ARGCNTG(ast);
NEED(count, lower_argument, int, lower_argument_size, count + 10);
Expand Down Expand Up @@ -5523,6 +5520,12 @@ lower_stmt(int std, int ast, int lineno, int label)
case A_MP_ENDDISTRIBUTE:
break;

case A_MP_LOOP:
break;

case A_MP_ELOOP:
break;

case A_MP_ETASKLOOP:
--lowersym.task_depth;
if (lowersym.parallel_depth == 0 && lowersym.task_depth == 0)
Expand Down Expand Up @@ -5729,6 +5732,10 @@ lower_stmt(int std, int ast, int lineno, int label)
case A_WHERE:
ast_error("unsupported ast optype in statement", ast);
break;
case A_ID: // TODO:
case A_SUBSCR: // TODO:
case A_BINOP: // TODO:
break;
default:
ast_error("unknown ast optype in statement", ast);
break;
Expand Down
6 changes: 6 additions & 0 deletions tools/flang1/flang1exe/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,12 @@ prettytoken(int tkntyp, INT tknval)
case TK_MP_REQUIRESUNIFIEDSHAREDMEMORY:
sprintf(symbuf, "%s", "REQUIRES UNIFIED_SHARED_MEMORY");
break;
case TK_MP_METADIR:
sprintf(symbuf, "%s", "METADIRECTIVE");
break;
case TK_MP_ENDMETADIR:
sprintf(symbuf, "%s", "ENDMETADIRECTIVE");
break;
// AOCC End
case TK_MP_SECTION:
sprintf(symbuf, "SECTION");
Expand Down
15 changes: 8 additions & 7 deletions tools/flang1/flang1exe/rest.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ insert_comm_before(int std, int ast, LOGICAL *rhs_is_dist, LOGICAL is_subscript)
case A_MP_IS_DEVICE_PTR: // AOCC
case A_MP_USE_DEVICE_ADDR: // AOCC
case A_MP_REQUIRESUNIFIEDSHAREDMEMORY: // AOCC
case A_MP_LOOP: // AOCC
case A_MP_ELOOP: // AOCC
return a;
default:
interr("insert_comm_before: unknown expression", std, 2);
Expand Down Expand Up @@ -1698,23 +1700,20 @@ transform_call(int std, int ast)
* if the passed object argument (denoted with tbp_inv) is a
* derived type component and the declared type is abstract.
*/
if ((A_TYPEG(ele) == A_SUBSCR) ||
(i == (tbp_inv-1) && (STYPEG(sptrsdsc) == ST_MEMBER ||
if (A_TYPEG(ele) == A_SUBSCR ||
(i == (tbp_inv-1) && (STYPEG(sptrsdsc) == ST_MEMBER ||
ABSTRACTG(VTABLEG(entry))))) {
/* Create temporary descriptor argument for the
* the element.
*/

int dest_ast;
int dtype = A_DTYPEG(ele);
int tmpv = get_tmp_descr(dtype);
int src_ast = check_member(ele, mk_id(sptrsdsc));
int sptrsdsc1 = sptrsdsc;

sptrsdsc = SDSCG(tmpv);
dest_ast = mk_id(sptrsdsc);
if (STYPEG(sptrsdsc1) == ST_MEMBER ) {
SCG(sptrsdsc) = SC_PRIVATE;
}

if (i == (tbp_inv-1)) {
A_INVOKING_DESCP(ast, dest_ast);
}
Expand Down Expand Up @@ -4339,6 +4338,8 @@ transform_all_call(int std, int ast)
case A_MP_IS_DEVICE_PTR: // AOCC
case A_MP_USE_DEVICE_ADDR: // AOCC
case A_MP_REQUIRESUNIFIEDSHAREDMEMORY: // AOCC
case A_MP_LOOP: // AOCC
case A_MP_ELOOP: // AOCC
return a;
case A_PRAGMA:
return a;
Expand Down
Loading

0 comments on commit ca75516

Please sign in to comment.