1*e4b17023SJohn Marino /* Translation of CLAST (CLooG AST) to Gimple. 2*e4b17023SJohn Marino Copyright (C) 2009, 2010 Free Software Foundation, Inc. 3*e4b17023SJohn Marino Contributed by Sebastian Pop <sebastian.pop@amd.com>. 4*e4b17023SJohn Marino 5*e4b17023SJohn Marino This file is part of GCC. 6*e4b17023SJohn Marino 7*e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify 8*e4b17023SJohn Marino it under the terms of the GNU General Public License as published by 9*e4b17023SJohn Marino the Free Software Foundation; either version 3, or (at your option) 10*e4b17023SJohn Marino any later version. 11*e4b17023SJohn Marino 12*e4b17023SJohn Marino GCC is distributed in the hope that it will be useful, 13*e4b17023SJohn Marino but WITHOUT ANY WARRANTY; without even the implied warranty of 14*e4b17023SJohn Marino MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15*e4b17023SJohn Marino GNU General Public License for more details. 16*e4b17023SJohn Marino 17*e4b17023SJohn Marino You should have received a copy of the GNU General Public License 18*e4b17023SJohn Marino along with GCC; see the file COPYING3. If not see 19*e4b17023SJohn Marino <http://www.gnu.org/licenses/>. */ 20*e4b17023SJohn Marino 21*e4b17023SJohn Marino #ifndef GCC_GRAPHITE_CLAST_TO_GIMPLE_H 22*e4b17023SJohn Marino #define GCC_GRAPHITE_CLAST_TO_GIMPLE_H 23*e4b17023SJohn Marino 24*e4b17023SJohn Marino #include "graphite-cloog-util.h" 25*e4b17023SJohn Marino 26*e4b17023SJohn Marino extern CloogState *cloog_state; 27*e4b17023SJohn Marino 28*e4b17023SJohn Marino /* Data structure for CLooG program representation. */ 29*e4b17023SJohn Marino 30*e4b17023SJohn Marino typedef struct cloog_prog_clast { 31*e4b17023SJohn Marino CloogProgram *prog; 32*e4b17023SJohn Marino struct clast_stmt *stmt; 33*e4b17023SJohn Marino } cloog_prog_clast; 34*e4b17023SJohn Marino 35*e4b17023SJohn Marino /* Stores BB's related PBB. */ 36*e4b17023SJohn Marino 37*e4b17023SJohn Marino typedef struct bb_pbb_def 38*e4b17023SJohn Marino { 39*e4b17023SJohn Marino basic_block bb; 40*e4b17023SJohn Marino poly_bb_p pbb; 41*e4b17023SJohn Marino } bb_pbb_def; 42*e4b17023SJohn Marino 43*e4b17023SJohn Marino extern bool gloog (scop_p, htab_t); 44*e4b17023SJohn Marino extern cloog_prog_clast scop_to_clast (scop_p); 45*e4b17023SJohn Marino extern void debug_clast_stmt (struct clast_stmt *); 46*e4b17023SJohn Marino extern void print_clast_stmt (FILE *, struct clast_stmt *); 47*e4b17023SJohn Marino 48*e4b17023SJohn Marino /* Hash function for data base element BB_PBB. */ 49*e4b17023SJohn Marino 50*e4b17023SJohn Marino static inline hashval_t bb_pbb_map_hash(const void * bb_pbb)51*e4b17023SJohn Marinobb_pbb_map_hash (const void *bb_pbb) 52*e4b17023SJohn Marino { 53*e4b17023SJohn Marino return (hashval_t)(((const bb_pbb_def *)bb_pbb)->bb->index); 54*e4b17023SJohn Marino } 55*e4b17023SJohn Marino 56*e4b17023SJohn Marino /* Compare data base element BB_PBB1 and BB_PBB2. */ 57*e4b17023SJohn Marino 58*e4b17023SJohn Marino static inline int eq_bb_pbb_map(const void * bb_pbb1,const void * bb_pbb2)59*e4b17023SJohn Marinoeq_bb_pbb_map (const void *bb_pbb1, const void *bb_pbb2) 60*e4b17023SJohn Marino { 61*e4b17023SJohn Marino const bb_pbb_def *bp1 = (const bb_pbb_def *) bb_pbb1; 62*e4b17023SJohn Marino const bb_pbb_def *bp2 = (const bb_pbb_def *) bb_pbb2; 63*e4b17023SJohn Marino return (bp1->bb->index == bp2->bb->index); 64*e4b17023SJohn Marino } 65*e4b17023SJohn Marino 66*e4b17023SJohn Marino #endif 67