Re: [PATCH] tree-optimization/96881 - CD-DCE and CLOBBERs

2022-02-17 Thread Richard Biener via Gcc-patches
On Thu, 17 Feb 2022, Jan Hubicka wrote: > > +/* Returns whether the control parents of BB are preserved. */ > > + > > +static bool > > +control_parents_preserved_p (basic_block bb) > > +{ > > + /* If we marked the control parents from BB they are preserved. */ > > + if (bitmap_bit_p

Re: [PATCH] tree-optimization/96881 - CD-DCE and CLOBBERs

2022-02-17 Thread Jan Hubicka via Gcc-patches
> +/* Returns whether the control parents of BB are preserved. */ > + > +static bool > +control_parents_preserved_p (basic_block bb) > +{ > + /* If we marked the control parents from BB they are preserved. */ > + if (bitmap_bit_p (visited_control_parents, bb->index)) > +return true; > + >

[PATCH] tree-optimization/96881 - CD-DCE and CLOBBERs

2022-02-17 Thread Richard Biener via Gcc-patches
CD-DCE does not consider CLOBBERs as necessary in the attempt to not prevent DCE of SSA defs it uses. A side-effect of that is that it also removes all its control dependences if they are not made necessary by other means. When we later try to preserve as many CLOBBERs as possible we have to

Re: [PATCH] tree-optimization/96881 - CD-DCE and CLOBBERs

2022-02-17 Thread Richard Biener via Gcc-patches
On Thu, 17 Feb 2022, Richard Biener wrote: > On Tue, 15 Feb 2022, Jan Hubicka wrote: > > > > @@ -1272,7 +1275,7 @@ maybe_optimize_arith_overflow (gimple_stmt_iterator > > > *gsi, > > > contributes nothing to the program, and can be deleted. */ > > > > > > static bool > > >

Re: [PATCH] tree-optimization/96881 - CD-DCE and CLOBBERs

2022-02-16 Thread Richard Biener via Gcc-patches
On Tue, 15 Feb 2022, Jan Hubicka wrote: > > @@ -1272,7 +1275,7 @@ maybe_optimize_arith_overflow (gimple_stmt_iterator > > *gsi, > > contributes nothing to the program, and can be deleted. */ > > > > static bool > > -eliminate_unnecessary_stmts (void) > > +eliminate_unnecessary_stmts

Re: [PATCH] tree-optimization/96881 - CD-DCE and CLOBBERs

2022-02-15 Thread Jan Hubicka via Gcc-patches
> @@ -1272,7 +1275,7 @@ maybe_optimize_arith_overflow (gimple_stmt_iterator > *gsi, > contributes nothing to the program, and can be deleted. */ > > static bool > -eliminate_unnecessary_stmts (void) > +eliminate_unnecessary_stmts (bool aggressive) > { >bool something_changed = false;

[PATCH] tree-optimization/96881 - CD-DCE and CLOBBERs

2022-02-15 Thread Richard Biener via Gcc-patches
CD-DCE does not consider CLOBBERs as necessary in the attempt to not prevent DCE of SSA defs it uses. A side-effect of that is that it also removes all its control dependences if they are not made necessary by other means. When we later try to preserve as many CLOBBERs as possible we have to