comparison gcc/tree-ssa-live.h @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* Routines for liveness in SSA trees. 1 /* Routines for liveness in SSA trees.
2 Copyright (C) 2003-2017 Free Software Foundation, Inc. 2 Copyright (C) 2003-2018 Free Software Foundation, Inc.
3 Contributed by Andrew MacLeod <amacleod@redhat.com> 3 Contributed by Andrew MacLeod <amacleod@redhat.com>
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify 7 GCC is free software; you can redistribute it and/or modify
60 /* Number of base variables in the base var list. */ 60 /* Number of base variables in the base var list. */
61 int num_basevars; 61 int num_basevars;
62 62
63 /* Map of partitions numbers to base variable table indexes. */ 63 /* Map of partitions numbers to base variable table indexes. */
64 int *partition_to_base_index; 64 int *partition_to_base_index;
65
66 /* Bitmap of basic block. It describes the region within which the analysis
67 is done. Using pointer avoids allocating memory in out-of-ssa case. */
68 bitmap bmp_bbs;
69
70 /* Vector of basic block in the region. */
71 vec<basic_block> vec_bbs;
72
73 /* True if this map is for out-of-ssa, otherwise for live range
74 computation. When for out-of-ssa, it also means the var map is computed
75 for whole current function. */
76 bool outofssa_p;
65 } *var_map; 77 } *var_map;
66 78
67 79
68 /* Value used to represent no partition number. */ 80 /* Value used to represent no partition number. */
69 #define NO_PARTITION -1 81 #define NO_PARTITION -1
70 82
71 extern var_map init_var_map (int); 83 extern var_map init_var_map (int, struct loop* = NULL);
72 extern void delete_var_map (var_map); 84 extern void delete_var_map (var_map);
73 extern int var_union (var_map, tree, tree); 85 extern int var_union (var_map, tree, tree);
74 extern void partition_view_normal (var_map); 86 extern void partition_view_normal (var_map);
75 extern void partition_view_bitmap (var_map, bitmap); 87 extern void partition_view_bitmap (var_map, bitmap);
76 extern void dump_scope_blocks (FILE *, dump_flags_t); 88 extern void dump_scope_blocks (FILE *, dump_flags_t);
80 extern void dump_var_map (FILE *, var_map); 92 extern void dump_var_map (FILE *, var_map);
81 extern void debug (_var_map &ref); 93 extern void debug (_var_map &ref);
82 extern void debug (_var_map *ptr); 94 extern void debug (_var_map *ptr);
83 95
84 96
97 /* Return TRUE if region of the MAP contains basic block BB. */
98
99 inline bool
100 region_contains_p (var_map map, basic_block bb)
101 {
102 /* It's possible that the function is called with ENTRY_BLOCK/EXIT_BLOCK. */
103 if (map->outofssa_p)
104 return (bb->index != ENTRY_BLOCK && bb->index != EXIT_BLOCK);
105
106 return bitmap_bit_p (map->bmp_bbs, bb->index);
107 }
108
109
85 /* Return number of partitions in MAP. */ 110 /* Return number of partitions in MAP. */
86 111
87 static inline unsigned 112 static inline unsigned
88 num_var_partitions (var_map map) 113 num_var_partitions (var_map map)
89 { 114 {
287 { 312 {
288 return live->map; 313 return live->map;
289 } 314 }
290 315
291 316
292 /* Merge the live on entry information in LIVE for partitions P1 and P2. Place
293 the result into P1. Clear P2. */
294
295 static inline void
296 live_merge_and_clear (tree_live_info_p live, int p1, int p2)
297 {
298 gcc_checking_assert (&live->livein[p1] && &live->livein[p2]);
299 bitmap_ior_into (&live->livein[p1], &live->livein[p2]);
300 bitmap_clear (&live->livein[p2]);
301 }
302
303
304 /* Mark partition P as live on entry to basic block BB in LIVE. */ 317 /* Mark partition P as live on entry to basic block BB in LIVE. */
305 318
306 static inline void 319 static inline void
307 make_live_on_entry (tree_live_info_p live, basic_block bb , int p) 320 make_live_on_entry (tree_live_info_p live, basic_block bb , int p)
308 { 321 {