Commit 17b95f0e by Jan Hubicka Committed by Jan Hubicka

lto-streamer-out.c (DFS::sccstack): Turn into auto-vec.

	* lto-streamer-out.c (DFS::sccstack): Turn into auto-vec.
	Preallocate for 32 entries.
	(DFS::worklist): Likewise.
	(DFS::DFS): Do not initialize sccstack and worklist.
	(DFS::~DFS): Do not release sccstack.

From-SVN: r278498
parent bcb4b4b4
2019-11-20 Jan Hubicka <jh@suse.cz>
* lto-streamer-out.c (DFS::sccstack): Turn into auto-vec.
Preallocate for 32 entries.
(DFS::worklist): Likewise.
(DFS::DFS): Do not initialize sccstack and worklist.
(DFS::~DFS): Do not release sccstack.
2019-11-20 Segher Boessenkool <segher@kernel.crashing.org> 2019-11-20 Segher Boessenkool <segher@kernel.crashing.org>
PR target/92573 PR target/92573
...@@ -514,7 +514,7 @@ public: ...@@ -514,7 +514,7 @@ public:
tree t; tree t;
hashval_t hash; hashval_t hash;
}; };
vec<scc_entry> sccstack; auto_vec<scc_entry,32> sccstack;
private: private:
struct sccs struct sccs
...@@ -544,7 +544,7 @@ private: ...@@ -544,7 +544,7 @@ private:
bool ref_p, bool this_ref_p); bool ref_p, bool this_ref_p);
hash_map<tree, sccs *> sccstate; hash_map<tree, sccs *> sccstate;
vec<worklist> worklist_vec; auto_vec<worklist, 32> worklist_vec;
struct obstack sccstate_obstack; struct obstack sccstate_obstack;
}; };
...@@ -558,9 +558,7 @@ DFS::DFS (struct output_block *ob, tree expr, bool ref_p, bool this_ref_p, ...@@ -558,9 +558,7 @@ DFS::DFS (struct output_block *ob, tree expr, bool ref_p, bool this_ref_p,
bool single_p) bool single_p)
{ {
unsigned int next_dfs_num = 1; unsigned int next_dfs_num = 1;
sccstack.create (0);
gcc_obstack_init (&sccstate_obstack); gcc_obstack_init (&sccstate_obstack);
worklist_vec = vNULL;
DFS_write_tree (ob, NULL, expr, ref_p, this_ref_p); DFS_write_tree (ob, NULL, expr, ref_p, this_ref_p);
while (!worklist_vec.is_empty ()) while (!worklist_vec.is_empty ())
{ {
...@@ -735,12 +733,10 @@ DFS::DFS (struct output_block *ob, tree expr, bool ref_p, bool this_ref_p, ...@@ -735,12 +733,10 @@ DFS::DFS (struct output_block *ob, tree expr, bool ref_p, bool this_ref_p,
from_state->low = MIN (cstate->dfsnum, from_state->low); from_state->low = MIN (cstate->dfsnum, from_state->low);
worklist_vec.pop (); worklist_vec.pop ();
} }
worklist_vec.release ();
} }
DFS::~DFS () DFS::~DFS ()
{ {
sccstack.release ();
obstack_free (&sccstate_obstack, NULL); obstack_free (&sccstate_obstack, NULL);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment