[PATCH] Remove dead labels to increase superblock scope

2011-11-18 Thread Tom de Vries
Hi Eric, this patch fixes an inefficiency problem I observed while working on PR50764. For the test-case of PR50764, a dead label is introduced by fixup_reorder_chain in cfg_layout_finalize, called from pass_reorder_blocks. The dead label is removed by a cleanup_cfg in pass_duplicate_computed_got

Re: [PATCH] Remove dead labels to increase superblock scope

2011-11-18 Thread Andrew Pinski
On Fri, Nov 18, 2011 at 5:11 AM, Tom de Vries wrote: > Hi Eric, > > this patch fixes an inefficiency problem I observed while working on PR50764. > > For the test-case of PR50764, a dead label is introduced by > fixup_reorder_chain > in cfg_layout_finalize, called from pass_reorder_blocks. > The

Re: [PATCH] Remove dead labels to increase superblock scope

2011-11-18 Thread Tom de Vries
On 11/18/2011 09:16 PM, Andrew Pinski wrote: > On Fri, Nov 18, 2011 at 5:11 AM, Tom de Vries wrote: >> Hi Eric, >> >> this patch fixes an inefficiency problem I observed while working on PR50764. >> >> For the test-case of PR50764, a dead label is introduced by >> fixup_reorder_chain >> in cfg_la

Re: [PATCH] Remove dead labels to increase superblock scope

2011-11-18 Thread Eric Botcazou
> For the test-case of PR50764, a dead label is introduced by > fixup_reorder_chain in cfg_layout_finalize, called from > pass_reorder_blocks. I presume that there is no reasonable way of preventing fixup_reorder_chain from introducing it or of teaching fixup_reorder_chain to remove it? -- Eric

Re: [PATCH] Remove dead labels to increase superblock scope

2011-11-18 Thread Tom de Vries
On 11/18/2011 10:29 PM, Eric Botcazou wrote: >> For the test-case of PR50764, a dead label is introduced by >> fixup_reorder_chain in cfg_layout_finalize, called from >> pass_reorder_blocks. > > I presume that there is no reasonable way of preventing fixup_reorder_chain > from introducing it or o

Re: [PATCH] Remove dead labels to increase superblock scope

2011-11-21 Thread Michael Matz
Hi, On Sat, 19 Nov 2011, Tom de Vries wrote: > On 11/18/2011 10:29 PM, Eric Botcazou wrote: > >> For the test-case of PR50764, a dead label is introduced by > >> fixup_reorder_chain in cfg_layout_finalize, called from > >> pass_reorder_blocks. > > > > I presume that there is no reasonable way of

Re: [PATCH] Remove dead labels to increase superblock scope

2011-11-25 Thread Tom de Vries
On 21/11/11 17:13, Michael Matz wrote: > Hi, > > On Sat, 19 Nov 2011, Tom de Vries wrote: > >> On 11/18/2011 10:29 PM, Eric Botcazou wrote: For the test-case of PR50764, a dead label is introduced by fixup_reorder_chain in cfg_layout_finalize, called from pass_reorder_blocks. >>> >

Re: [PATCH] Remove dead labels to increase superblock scope

2011-11-25 Thread Michael Matz
Hi, On Fri, 25 Nov 2011, Tom de Vries wrote: > > Note that you actually can remove labels also if they are > > !can_delete_label_p, if you use delete_insn (which you do). It will > > replace such undeletable labels by a DELETED_LABEL note. > > I tried that as well but ran into these errors in

Re: [PATCH] Remove dead labels to increase superblock scope

2011-11-25 Thread Steven Bosscher
On Fri, Nov 25, 2011 at 2:03 PM, Michael Matz wrote: > Hi, > > On Fri, 25 Nov 2011, Tom de Vries wrote: > >> > Note that you actually can remove labels also if they are >> > !can_delete_label_p, if you use delete_insn (which you do).  It will >> > replace such undeletable labels by a DELETED_LABEL

Re: [PATCH] Remove dead labels to increase superblock scope

2011-11-25 Thread Tom de Vries
On 25/11/11 14:05, Steven Bosscher wrote: > On Fri, Nov 25, 2011 at 2:03 PM, Michael Matz wrote: >> Hi, >> >> On Fri, 25 Nov 2011, Tom de Vries wrote: >> Note that you actually can remove labels also if they are !can_delete_label_p, if you use delete_insn (which you do). It will re

Re: [PATCH] Remove dead labels to increase superblock scope

2011-11-27 Thread Eric Botcazou
> No, DELETED_LABEL notes still work just fine. It depends on how you > remove the label and replace it with a note, and Tom isn't showing > what he did, so... I agree that there is no obvious reason why just calling delete_insn would not work, so this should be investigated first. -- Eric Botc

Re: [PATCH] Remove dead labels to increase superblock scope

2011-12-01 Thread Tom de Vries
On 27/11/11 23:59, Eric Botcazou wrote: >> No, DELETED_LABEL notes still work just fine. It depends on how you >> remove the label and replace it with a note, and Tom isn't showing >> what he did, so... > > I agree that there is no obvious reason why just calling delete_insn would > not > work,

Re: [PATCH] Remove dead labels to increase superblock scope

2011-12-02 Thread Richard Sandiford
Tom de Vries writes: > On 27/11/11 23:59, Eric Botcazou wrote: >>> No, DELETED_LABEL notes still work just fine. It depends on how you >>> remove the label and replace it with a note, and Tom isn't showing >>> what he did, so... >> >> I agree that there is no obvious reason why just calling delet

Re: [PATCH] Remove dead labels to increase superblock scope

2011-12-03 Thread Tom de Vries
On 02/12/11 11:40, Richard Sandiford wrote: > Tom de Vries writes: >> On 27/11/11 23:59, Eric Botcazou wrote: No, DELETED_LABEL notes still work just fine. It depends on how you remove the label and replace it with a note, and Tom isn't showing what he did, so... >>> >>> I agree tha

Re: [PATCH] Remove dead labels to increase superblock scope

2011-12-04 Thread Richard Sandiford
Tom de Vries writes: > OK, factored out delete_label now. > > Bootstrapped and reg-tested on x86_64. > > Ok for next stage1? Looks good codewise. I'm just a bit worried about the name "delete_label". "delete_insn (label)" should always do the right thing for a pure deletion; the point of the new

Re: [PATCH] Remove dead labels to increase superblock scope

2011-12-04 Thread Eric Botcazou
> Looks good codewise. Seconded, modulo the file: the function should be in cfgrtl.c instead. > I'm just a bit worried about the name "delete_label". > "delete_insn (label)" should always do the right thing for a pure deletion; > the point of the new routine is that it also moves instructions.

Re: [PATCH] Remove dead labels to increase superblock scope

2011-12-05 Thread Michael Matz
Hi, On Sun, 4 Dec 2011, Eric Botcazou wrote: > > I'm just a bit worried about the name "delete_label". "delete_insn > > (label)" should always do the right thing for a pure deletion; the > > point of the new routine is that it also moves instructions. > > It only fixes things up though, so tha

Re: [PATCH] Remove dead labels to increase superblock scope

2011-12-06 Thread Tom de Vries
On 05/12/11 13:50, Michael Matz wrote: > Hi, > > On Sun, 4 Dec 2011, Eric Botcazou wrote: > >>> I'm just a bit worried about the name "delete_label". "delete_insn >>> (label)" should always do the right thing for a pure deletion; the >>> point of the new routine is that it also moves instructio

Re: [PATCH] Remove dead labels to increase superblock scope

2011-12-06 Thread Michael Matz
Hi, On Tue, 6 Dec 2011, Tom de Vries wrote: > what should be the 'next' returned by delete_insn? There are exactly two calls of delete_insn that take the return value. One (delete_insn_and_edges) just uses it to return it itself (and there are no calls to delete_insn_and_edges that use the re

Re: [PATCH] Remove dead labels to increase superblock scope

2011-12-07 Thread Tom de Vries
On 06/12/11 14:25, Michael Matz wrote: > Hi, > > On Tue, 6 Dec 2011, Tom de Vries wrote: > >> what should be the 'next' returned by delete_insn? > > There are exactly two calls of delete_insn that take the return value. > One (delete_insn_and_edges) just uses it to return it itself (and there

Re: [PATCH] Remove dead labels to increase superblock scope

2011-12-09 Thread Eric Botcazou
> 2011-12-07 Tom de Vries > > * cfgcleanup.c (try_optimize_cfg): Replace call to delete_isns_chain by delete_insn_chain > call to delete_insn. Remove code to reorder BASIC_BLOCK note and > DELETED_LABEL note, and move it to ... > * cfg_rtl.c (delete_insn): Change retu

Re: [PATCH] Remove dead labels to increase superblock scope

2012-04-14 Thread Tom de Vries
On 09/12/11 14:59, Eric Botcazou wrote: >> 2011-12-07 Tom de Vries >> >> * cfgcleanup.c (try_optimize_cfg): Replace call to delete_isns_chain by > > delete_insn_chain > >> call to delete_insn. Remove code to reorder BASIC_BLOCK note and >> DELETED_LABEL note, and move it to ...