gomp-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gomp-discuss] Open64's implementation of OpenMP


From: Pop Sébastian
Subject: [Gomp-discuss] Open64's implementation of OpenMP
Date: Mon, 3 Feb 2003 18:03:24 +0100
User-agent: Mutt/1.4i

Hi, 

Here is what I found in Open64's compiler:
- language specific pragmas are handled in front-ends
- Fortran MP Lowering Support: ./osprey1.0/be/com/wn_mp.cxx
- Pragma creation for F90 front-end happens in 
  ./osprey1.0/crayf90/sgi/cwh_directive.cxx

- a tree (WHIRL) node: OPC_PRAGMA contains the type and arguments 
  for a given pragma.  They are described in ./osprey1.0/common/com/wn_pragmas.h
  and attached to this mail (I think that this could be useful, 
  and I hope it is not too big for this mailing list).

- the lowering of OpenMP nodes can be found in ./osprey1.0/be/be/omp_lower.cxx

- all OPC_PRAGMA nodes are not lowered: some pragmas subsist until the 
  translation to ops (code generator representation).

- analyzers can introduce pragma nodes (constructor: WN_CreatePragma)
  For example: 
  - array data flow analysis introduces lots of pragmas:
    WN_PRAGMA_SHARED, WN_PRAGMA_LOCAL, WN_PRAGMA_MPSCHEDTYPE, ...
    ./osprey1.0/be/lno/ara_loop.cxx
  - Induction Variable analyzer updates pragmas by adding: 
    WN_PRAGMA_SHARED, WN_PRAGMA_LASTLOCAL, WN_PRAGMA_REDUCTION, 
    WN_PRAGMA_FIRSTPRIVATE for secondary IVs.


Here is what I found in GCC that could be of use:
- In ./gcc/gcc/c-pragma.[ch]: Pragma related interfaces.
  There is already code that deals with the "#pragma weak": 
  have a look at the results of a "grep pragma *.c" in gcc/gcc/

----
/* Set up front-end pragmas.  */
void
init_pragma ()
{
#ifdef HANDLE_PRAGMA_PACK
  c_register_pragma (0, "pack", handle_pragma_pack);
#endif
#ifdef HANDLE_PRAGMA_WEAK
  c_register_pragma (0, "weak", handle_pragma_weak);
#endif
#ifdef HANDLE_PRAGMA_REDEFINE_EXTNAME
  c_register_pragma (0, "redefine_extname", handle_pragma_redefine_extname);
#endif
#ifdef HANDLE_PRAGMA_EXTERN_PREFIX
  c_register_pragma (0, "extern_prefix", handle_pragma_extern_prefix);
#endif

#ifdef REGISTER_TARGET_PRAGMAS
  REGISTER_TARGET_PRAGMAS ();
#endif
}
----

So I think that here is where we will "parse" OMP pragmas arguments...
Another extension will just build an equivalent tree node as 
for Open64's OPC_PRAGMA node.  

I don't think that implementing another mini-C front-end based on treelang 
will help our design.  

Comments?

Attachment: OMP.tar.gz
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]