gcc/testsuite/
[gcc.git] / gcc / graphite-htab.h
1 /* Translation of CLAST (CLooG AST) to Gimple.
2 Copyright (C) 2012-2014 Free Software Foundation, Inc.
3 Contributed by Sebastian Pop <sebastian.pop@amd.com>.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
20
21 #ifndef GCC_GRAPHITE_HTAB_H
22 #define GCC_GRAPHITE_HTAB_H
23
24 #include "hash-table.h"
25
26 /* Stores BB's related PBB. */
27
28 struct bb_pbb_def
29 {
30 basic_block bb;
31 poly_bb_p pbb;
32 };
33
34 /* Hashtable helpers. */
35
36 struct bb_pbb_hasher : typed_free_remove <bb_pbb_def>
37 {
38 typedef bb_pbb_def value_type;
39 typedef bb_pbb_def compare_type;
40 static inline hashval_t hash (const value_type *);
41 static inline bool equal (const value_type *, const compare_type *);
42 };
43
44 /* Hash function for data base element BB_PBB. */
45
46 inline hashval_t
47 bb_pbb_hasher::hash (const value_type *bb_pbb)
48 {
49 return (hashval_t)(bb_pbb->bb->index);
50 }
51
52 /* Compare data base element PB1 and PB2. */
53
54 inline bool
55 bb_pbb_hasher::equal (const value_type *bp1, const compare_type *bp2)
56 {
57 return (bp1->bb->index == bp2->bb->index);
58 }
59
60 typedef hash_table<bb_pbb_hasher> bb_pbb_htab_type;
61
62 poly_bb_p find_pbb_via_hash (bb_pbb_htab_type *, basic_block);
63 bool loop_is_parallel_p (loop_p, bb_pbb_htab_type *, int);
64 scop_p get_loop_body_pbbs (loop_p, bb_pbb_htab_type *, vec<poly_bb_p> *);
65
66 #endif