Skip to content
Snippets Groups Projects
Commit 675ac882 authored by Richard Biener's avatar Richard Biener
Browse files

rtl-optimization/109237 - quadraticness in delete_trivially_dead_insns

The following addresses quadraticness in processing debug insns
in delete_trivially_dead_insns and insn_live_p by using TREE_VISITED
on the INSN_VAR_LOCATION_DECL to indicate a later debug bind
with the same decl and no intervening real insn or debug marker.
That gets rid of the NEXT_INSN walk in insn_live_p in favor of
first clearing TREE_VISITED in the first loop over insn and
the book-keeping of decls we set the bit since we need to clear
them when visiting a real or debug marker insn.

That improves the time spent in delete_trivially_dead_insns from
10.6s to 2.2s for the testcase.

	PR rtl-optimization/109237
	* cse.cc (insn_live_p): Remove NEXT_INSN walk, instead check
	TREE_VISITED on INSN_VAR_LOCATION_DECL.
	(delete_trivially_dead_insns): Maintain TREE_VISITED on
	active debug bind INSN_VAR_LOCATION_DECL.
parent 8f811001
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment