Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-12-04 Thread Jeff Law
On 12/04/2015 03:12 AM, Richard Biener wrote: On Thu, Dec 3, 2015 at 9:29 PM, Jeff Law wrote: On 12/02/2015 08:35 AM, Richard Biener wrote: The most interesting side effect, and one I haven't fully analyzed yet is an unexpected jump thread -- which I've traced back to differences in what the

Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-12-04 Thread Richard Biener
On Thu, Dec 3, 2015 at 9:29 PM, Jeff Law wrote: > On 12/02/2015 08:35 AM, Richard Biener wrote: > >>> >>> The most interesting side effect, and one I haven't fully analyzed yet is >>> an >>> unexpected jump thread -- which I've traced back to differences in what >>> the >>> alias oracle is able to

Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-12-03 Thread Jeff Law
On 12/02/2015 08:35 AM, Richard Biener wrote: The most interesting side effect, and one I haven't fully analyzed yet is an unexpected jump thread -- which I've traced back to differences in what the alias oracle is able to find when we walk unaliased vuses. Which makes totally no sense that it'

Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-12-03 Thread Richard Biener
On Wed, Dec 2, 2015 at 11:56 PM, Jeff Law wrote: > On 12/02/2015 08:35 AM, Richard Biener wrote: > be possible to make it do that much like I extended SCCVN to do this (when doing the DOM walk see if any incoming edge is marked executable and if not, mark all outgoing edges as not e

Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-12-02 Thread Jeff Law
On 12/02/2015 08:35 AM, Richard Biener wrote: be possible to make it do that much like I extended SCCVN to do this (when doing the DOM walk see if any incoming edge is marked executable and if not, mark all outgoing edges as not executable, if the block is executable at the time we process the l

Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-12-02 Thread Richard Biener
On Wed, Dec 2, 2015 at 4:31 PM, Jeff Law wrote: > On 12/02/2015 02:54 AM, Richard Biener wrote: >>> >>> Deferring to cfg_cleanup works because if cfg_cleanup does anything, it >>> sets >>> LOOPS_NEED_FIXUP (which we were trying to avoid in DOM). So it seems >>> that >>> the gyrations we often do

Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-12-02 Thread Jeff Law
On 12/02/2015 02:54 AM, Richard Biener wrote: Deferring to cfg_cleanup works because if cfg_cleanup does anything, it sets LOOPS_NEED_FIXUP (which we were trying to avoid in DOM). So it seems that the gyrations we often do to avoid LOOPS_NEED_FIXUP are probably not all that valuable in the end.

Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-12-02 Thread Richard Biener
On Tue, Dec 1, 2015 at 10:32 PM, Jeff Law wrote: > On 10/09/2015 09:45 AM, Jeff Law wrote: >>> >>> Yes, but as you remove jump threading paths you could leave the CFG >>> change to >>> cfg-cleanup anyway? To get better behavior wrt loop fixup at least? >> >> So go ahead and detect, remove the thr

Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-12-01 Thread Jeff Law
On 10/09/2015 09:45 AM, Jeff Law wrote: Yes, but as you remove jump threading paths you could leave the CFG change to cfg-cleanup anyway? To get better behavior wrt loop fixup at least? So go ahead and detect, remove the threading paths, but leave final fixup to cfg-cleanup. I can certainly tr

Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-10-09 Thread Jeff Law
On 10/08/2015 03:56 AM, Richard Biener wrote: On Thu, Oct 8, 2015 at 12:00 AM, Jeff Law wrote: On 10/07/2015 02:26 AM, Richard Biener wrote: Hmm, other passes avoid all this by not removing edges or blocks themselves but leaving that to cfgcleanup. They simply replace the condition in GIMPL

Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-10-08 Thread Richard Biener
On Thu, Oct 8, 2015 at 12:00 AM, Jeff Law wrote: > On 10/07/2015 02:26 AM, Richard Biener wrote: > >> >> Hmm, other passes avoid all this by not removing edges or blocks >> themselves but leaving that to cfgcleanup. They simply replace the >> condition in GIMPLE_CONDs or the switch value in GIMPL

Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-10-07 Thread Jeff Law
On 10/07/2015 02:26 AM, Richard Biener wrote: Hmm, other passes avoid all this by not removing edges or blocks themselves but leaving that to cfgcleanup. They simply replace the condition in GIMPLE_CONDs or the switch value in GIMPLE_SWITCHes and let cleanup_control_expr_graph do the hard part

Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-10-07 Thread Richard Biener
On Wed, Oct 7, 2015 at 4:26 AM, Jeff Law wrote: > > As touched on in the BZ, we record jump threads as a list of edges to > traverse. A jump thread may be recorded through a block which hasn't been > optimized by DOM yet. > > If DOM is able to optimize a control flow statement in such a block, th

[PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path

2015-10-06 Thread Jeff Law
As touched on in the BZ, we record jump threads as a list of edges to traverse. A jump thread may be recorded through a block which hasn't been optimized by DOM yet. If DOM is able to optimize a control flow statement in such a block, then it will remove one or more outgoing edges from the