GCC Middle and Back End API Reference
cilk.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CILK_FRAME_UNSYNCHED   0x02
#define CILK_FRAME_DETACHED   0x04
#define CILK_FRAME_EXCEPTING   0x10
#define CILK_FRAME_VERSION   (1 << 24)
#define cilk_worker_fndecl   cilk_trees[CILK_TI_F_WORKER]
#define cilk_sync_fndecl   cilk_trees[CILK_TI_F_SYNC]
#define cilk_synched_fndecl   cilk_trees[CILK_TI_F_SYNCED]
#define cilk_detach_fndecl   cilk_trees[CILK_TI_F_DETACH]
#define cilk_enter_fndecl   cilk_trees[CILK_TI_F_ENTER]
#define cilk_enter_fast_fndecl   cilk_trees[CILK_TI_F_ENTER_FAST]
#define cilk_leave_fndecl   cilk_trees[CILK_TI_F_LEAVE]
#define cilk_rethrow_fndecl   cilk_trees[CILK_TI_F_RETHROW]
#define cilk_pop_fndecl   cilk_trees[CILK_TI_F_POP]
#define cilk_save_fp_fndecl   cilk_trees[CILK_TI_F_SAVE_FP]
#define cilk_worker_type_fndecl   cilk_trees[CILK_TI_WORKER_TYPE]
#define cilk_frame_type_decl   cilk_trees[CILK_TI_FRAME_TYPE]
#define cilk_frame_ptr_type_decl   cilk_trees[CILK_TI_FRAME_PTR]
#define cilk_pedigree_type_decl   cilk_trees[CILK_TI_PEDIGREE_TYPE]

Enumerations

enum  cilk_tree_index {
  CILK_TI_F_WORKER = 0, CILK_TI_F_SYNC, CILK_TI_F_DETACH, CILK_TI_F_ENTER,
  CILK_TI_F_ENTER_FAST, CILK_TI_F_LEAVE, CILK_TI_F_POP, CILK_TI_F_RETHROW,
  CILK_TI_F_SAVE_FP, CILK_TI_FRAME_FLAGS, CILK_TI_FRAME_PARENT, CILK_TI_FRAME_WORKER,
  CILK_TI_FRAME_EXCEPTION, CILK_TI_FRAME_CONTEXT, CILK_TI_FRAME_PEDIGREE, CILK_TI_WORKER_CUR,
  CILK_TI_WORKER_TAIL, CILK_TI_WORKER_PEDIGREE, CILK_TI_PEDIGREE_RANK, CILK_TI_PEDIGREE_PARENT,
  CILK_TI_FRAME_TYPE, CILK_TI_FRAME_PTR, CILK_TI_WORKER_TYPE, CILK_TI_PEDIGREE_TYPE,
  CILK_TI_MAX
}

Functions

void expand_builtin_cilk_detach (tree)
void expand_builtin_cilk_pop_frame (tree)
tree cilk_arrow (tree, int, bool)
tree cilk_dot (tree, int, bool)
void cilk_init_builtins (void)
void gimplify_cilk_sync (tree *, gimple_seq *)
tree cilk_call_setjmp (tree)
bool fn_contains_cilk_spawn_p ()

Variables

tree cilk_trees [CILK_TI_MAX]

Macro Definition Documentation

#define cilk_detach_fndecl   cilk_trees[CILK_TI_F_DETACH]
#define cilk_enter_fast_fndecl   cilk_trees[CILK_TI_F_ENTER_FAST]
#define cilk_enter_fndecl   cilk_trees[CILK_TI_F_ENTER]
#define CILK_FRAME_DETACHED   0x04
#define CILK_FRAME_EXCEPTING   0x10
#define cilk_frame_ptr_type_decl   cilk_trees[CILK_TI_FRAME_PTR]
#define cilk_frame_type_decl   cilk_trees[CILK_TI_FRAME_TYPE]
#define CILK_FRAME_UNSYNCHED   0x02

This file is part of the Intel(R) Cilk(TM) Plus support This file contains Cilk Support files. Copyright (C) 2013 Free Software Foundation, Inc. Contributed by Balaji V. Iyer balaj.nosp@m.i.v..nosp@m.iyer@.nosp@m.inte.nosp@m.l.com, Intel Corporation

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. Frame status bits known to compiler.

#define CILK_FRAME_VERSION   (1 << 24)
#define cilk_leave_fndecl   cilk_trees[CILK_TI_F_LEAVE]
#define cilk_pedigree_type_decl   cilk_trees[CILK_TI_PEDIGREE_TYPE]
#define cilk_pop_fndecl   cilk_trees[CILK_TI_F_POP]
#define cilk_rethrow_fndecl   cilk_trees[CILK_TI_F_RETHROW]
#define cilk_save_fp_fndecl   cilk_trees[CILK_TI_F_SAVE_FP]
#define cilk_sync_fndecl   cilk_trees[CILK_TI_F_SYNC]
#define cilk_synched_fndecl   cilk_trees[CILK_TI_F_SYNCED]
#define cilk_worker_fndecl   cilk_trees[CILK_TI_F_WORKER]
#define cilk_worker_type_fndecl   cilk_trees[CILK_TI_WORKER_TYPE]

Enumeration Type Documentation

Enumerator:
CILK_TI_F_WORKER 

All the built-in functions for Cilk keywords.

CILK_TI_F_SYNC 
CILK_TI_F_DETACH 
CILK_TI_F_ENTER 
CILK_TI_F_ENTER_FAST 
CILK_TI_F_LEAVE 
CILK_TI_F_POP 
CILK_TI_F_RETHROW 
CILK_TI_F_SAVE_FP 
CILK_TI_FRAME_FLAGS 

__cilkrts_stack_frame struct fields.

CILK_TI_FRAME_PARENT 
CILK_TI_FRAME_WORKER 
CILK_TI_FRAME_EXCEPTION 
CILK_TI_FRAME_CONTEXT 
CILK_TI_FRAME_PEDIGREE 
CILK_TI_WORKER_CUR 

__cilkrts_worker struct fields.

CILK_TI_WORKER_TAIL 
CILK_TI_WORKER_PEDIGREE 
CILK_TI_PEDIGREE_RANK 

__cilkrts_pedigree struct fields.

CILK_TI_PEDIGREE_PARENT 
CILK_TI_FRAME_TYPE 

Types.

CILK_TI_FRAME_PTR 
CILK_TI_WORKER_TYPE 
CILK_TI_PEDIGREE_TYPE 
CILK_TI_MAX 

Function Documentation

tree cilk_arrow ( tree  ,
int  ,
bool   
)
tree cilk_call_setjmp ( tree  )
tree cilk_dot ( tree  ,
int  ,
bool   
)
void cilk_init_builtins ( void  )

Creates and initializes all the built-in Cilk keywords functions and three structures: __cilkrts_stack_frame, __cilkrts_pedigree and __cilkrts_worker. Detailed information about __cilkrts_stack_frame and __cilkrts_worker structures are given in libcilkrts/include/internal/abi.h. __cilkrts_pedigree is described in libcilkrts/include/cilk/common.h.

 Now build the following __cilkrts_pedigree struct:
 struct __cilkrts_pedigree {
    uint64_t rank;
    struct __cilkrts_pedigree *parent;
  }   
 Build the Cilk Stack Frame:
 struct __cilkrts_stack_frame {
   uint32_t flags;
   uint32_t size;
   struct __cilkrts_stack_frame *call_parent;
   __cilkrts_worker *worker;
   void *except_data;
   void *ctx[4];
   uint32_t mxcsr;
   uint16_t fpcsr;
   uint16_t reserved;
   __cilkrts_pedigree pedigree;
 };   
 Now add them to a common structure whose fields are #defined to something
 that is used at a later stage.   
 We don't care about reserved, so no need to store it in cilk_trees.   
 Now let's do the following worker struct:

 struct __cilkrts_worker {
   __cilkrts_stack_frame *volatile *volatile tail;
   __cilkrts_stack_frame *volatile *volatile head;
   __cilkrts_stack_frame *volatile *volatile exc;
   __cilkrts_stack_frame *volatile *volatile protected_tail;
   __cilkrts_stack_frame *volatile *ltq_limit;
   int32_t self;
   global_state_t *g;
   local_state *l;
   cilkred_map *reducer_map;
   __cilkrts_stack_frame *current_stack_frame;
   void *reserved;
   __cilkrts_worker_sysdep_state *sysdep;
   __cilkrts_pedigree pedigree;
}    
 void __cilkrts_enter_frame_1 (__cilkrts_stack_frame *);   
 void __cilkrts_enter_frame_fast_1 (__cilkrts_stack_frame *);   
 void __cilkrts_pop_frame (__cilkrts_stack_frame *);   
 void __cilkrts_leave_frame (__cilkrts_stack_frame *);   
 void __cilkrts_sync (__cilkrts_stack_frame *);   
 void __cilkrts_detach (__cilkrts_stack_frame *);   
 __cilkrts_rethrow (struct stack_frame *);   
 __cilkrts_save_fp_ctrl_state (__cilkrts_stack_frame *);   
void expand_builtin_cilk_detach ( tree  )
void expand_builtin_cilk_pop_frame ( tree  )
bool fn_contains_cilk_spawn_p ( )
inline

Returns true if Cilk Plus is enabled and if F->cilk_frame_decl is not NULL_TREE.

Referenced by gimplify_omp_workshare().

void gimplify_cilk_sync ( tree ,
gimple_seq  
)

Variable Documentation

tree cilk_trees[CILK_TI_MAX]

This file is part of the Intel(R) Cilk(TM) Plus support This file contains the CilkPlus Intrinsics Copyright (C) 2013 Free Software Foundation, Inc. Contributed by Balaji V. Iyer balaj.nosp@m.i.v..nosp@m.iyer@.nosp@m.inte.nosp@m.l.com, Intel Corporation

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. This structure holds all the important fields of the internal structures, internal built-in functions, and Cilk-specific data types. Explanation of all the these fielsd are given in cilk.h.