aboutsummaryrefslogtreecommitdiff
path: root/gcc/ddg.c
diff options
context:
space:
mode:
authorTrevor Saunders <tbsaunde+gcc@tbsaunde.org>2017-05-14 00:39:08 +0000
committerTrevor Saunders <tbsaunde@gcc.gnu.org>2017-05-14 00:39:08 +0000
commit8f48c62273af6ac7a4583d7588c07752f2a86689 (patch)
tree229119b42abcb983fbd6fc1aa9c6da87e1ea5323 /gcc/ddg.c
parent0236bb04126d2700e257ab5d3e52f787ec40c63f (diff)
downloadgcc-8f48c62273af6ac7a4583d7588c07752f2a86689.zip
gcc-8f48c62273af6ac7a4583d7588c07752f2a86689.tar.gz
gcc-8f48c62273af6ac7a4583d7588c07752f2a86689.tar.bz2
make more vars auto_sbitmaps
gcc/ChangeLog: 2017-05-13 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * ddg.c (find_nodes_on_paths): Use auto_sbitmap. (longest_simple_path): Likewise. * shrink-wrap.c (spread_components): Likewise. (disqualify_problematic_components): Likewise. (emit_common_heads_for_components): Likewise. (emit_common_tails_for_components): Likewise. (insert_prologue_epilogue_for_components): Likewise. From-SVN: r248025
Diffstat (limited to 'gcc/ddg.c')
-rw-r--r--gcc/ddg.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/gcc/ddg.c b/gcc/ddg.c
index 9ea98d6..8aaed80 100644
--- a/gcc/ddg.c
+++ b/gcc/ddg.c
@@ -1081,16 +1081,15 @@ free_ddg_all_sccs (ddg_all_sccs_ptr all_sccs)
int
find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to)
{
- int answer;
int change;
unsigned int u = 0;
int num_nodes = g->num_nodes;
sbitmap_iterator sbi;
- sbitmap workset = sbitmap_alloc (num_nodes);
- sbitmap reachable_from = sbitmap_alloc (num_nodes);
- sbitmap reach_to = sbitmap_alloc (num_nodes);
- sbitmap tmp = sbitmap_alloc (num_nodes);
+ auto_sbitmap workset (num_nodes);
+ auto_sbitmap reachable_from (num_nodes);
+ auto_sbitmap reach_to (num_nodes);
+ auto_sbitmap tmp (num_nodes);
bitmap_copy (reachable_from, from);
bitmap_copy (tmp, from);
@@ -1150,12 +1149,7 @@ find_nodes_on_paths (sbitmap result, ddg_ptr g, sbitmap from, sbitmap to)
}
}
- answer = bitmap_and (result, reachable_from, reach_to);
- sbitmap_free (workset);
- sbitmap_free (reachable_from);
- sbitmap_free (reach_to);
- sbitmap_free (tmp);
- return answer;
+ return bitmap_and (result, reachable_from, reach_to);
}
@@ -1195,10 +1189,9 @@ longest_simple_path (struct ddg * g, int src, int dest, sbitmap nodes)
int i;
unsigned int u = 0;
int change = 1;
- int result;
int num_nodes = g->num_nodes;
- sbitmap workset = sbitmap_alloc (num_nodes);
- sbitmap tmp = sbitmap_alloc (num_nodes);
+ auto_sbitmap workset (num_nodes);
+ auto_sbitmap tmp (num_nodes);
/* Data will hold the distance of the longest path found so far from
@@ -1224,10 +1217,7 @@ longest_simple_path (struct ddg * g, int src, int dest, sbitmap nodes)
change |= update_dist_to_successors (u_node, nodes, tmp);
}
}
- result = g->nodes[dest].aux.count;
- sbitmap_free (workset);
- sbitmap_free (tmp);
- return result;
+ return g->nodes[dest].aux.count;
}
#endif /* INSN_SCHEDULING */