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.
+
+2017-05-13 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
* tree-ssa-dse.c (dse_dom_walker): Make m_live_byes a
auto_sbitmap.
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);
}
}
- 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);
}
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
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 */
todo.create (n_basic_blocks_for_fn (cfun));
auto_bitmap seen;
- sbitmap old = sbitmap_alloc (SBITMAP_SIZE (components));
+ auto_sbitmap old (SBITMAP_SIZE (components));
/* Find for every block the components that are *not* needed on some path
from the entry to that block. Do this with a flood fill from the entry
fprintf (dump_file, "\n");
}
}
-
- sbitmap_free (old);
}
/* If we cannot handle placing some component's prologues or epilogues where
static void
disqualify_problematic_components (sbitmap components)
{
- sbitmap pro = sbitmap_alloc (SBITMAP_SIZE (components));
- sbitmap epi = sbitmap_alloc (SBITMAP_SIZE (components));
+ auto_sbitmap pro (SBITMAP_SIZE (components));
+ auto_sbitmap epi (SBITMAP_SIZE (components));
basic_block bb;
FOR_EACH_BB_FN (bb, cfun)
}
}
}
-
- sbitmap_free (pro);
- sbitmap_free (epi);
}
/* Place code for prologues and epilogues for COMPONENTS where we can put
static void
emit_common_heads_for_components (sbitmap components)
{
- sbitmap pro = sbitmap_alloc (SBITMAP_SIZE (components));
- sbitmap epi = sbitmap_alloc (SBITMAP_SIZE (components));
- sbitmap tmp = sbitmap_alloc (SBITMAP_SIZE (components));
+ auto_sbitmap pro (SBITMAP_SIZE (components));
+ auto_sbitmap epi (SBITMAP_SIZE (components));
+ auto_sbitmap tmp (SBITMAP_SIZE (components));
basic_block bb;
FOR_ALL_BB_FN (bb, cfun)
bitmap_ior (SW (bb)->head_components, SW (bb)->head_components, epi);
}
}
-
- sbitmap_free (pro);
- sbitmap_free (epi);
- sbitmap_free (tmp);
}
/* Place code for prologues and epilogues for COMPONENTS where we can put
static void
emit_common_tails_for_components (sbitmap components)
{
- sbitmap pro = sbitmap_alloc (SBITMAP_SIZE (components));
- sbitmap epi = sbitmap_alloc (SBITMAP_SIZE (components));
- sbitmap tmp = sbitmap_alloc (SBITMAP_SIZE (components));
+ auto_sbitmap pro (SBITMAP_SIZE (components));
+ auto_sbitmap epi (SBITMAP_SIZE (components));
+ auto_sbitmap tmp (SBITMAP_SIZE (components));
basic_block bb;
FOR_ALL_BB_FN (bb, cfun)
bitmap_ior (SW (bb)->tail_components, SW (bb)->tail_components, pro);
}
}
-
- sbitmap_free (pro);
- sbitmap_free (epi);
- sbitmap_free (tmp);
}
/* Place prologues and epilogues for COMPONENTS on edges, if we haven't already
static void
insert_prologue_epilogue_for_components (sbitmap components)
{
- sbitmap pro = sbitmap_alloc (SBITMAP_SIZE (components));
- sbitmap epi = sbitmap_alloc (SBITMAP_SIZE (components));
+ auto_sbitmap pro (SBITMAP_SIZE (components));
+ auto_sbitmap epi (SBITMAP_SIZE (components));
basic_block bb;
FOR_EACH_BB_FN (bb, cfun)
}
}
- sbitmap_free (pro);
- sbitmap_free (epi);
-
commit_edge_insertions ();
}