[RFA][PR rtl-optimization/70263] Fix creation of new REG_EQUIV notes

2016-03-20 Thread Jeff Law
update_equiv_regs will search for (set (MEM) (REG)) where the REG is only used in a single basic block and is always equivalent to the memory location in that block and if moving the store from its present location to the insn which sets REG would be safe. If those conditions are met, then

Re: [RFA][PR rtl-optimization/70263] Fix creation of new REG_EQUIV notes

2016-03-19 Thread David Malcolm
On Fri, 2016-03-18 at 13:20 -0600, Jeff Law wrote: > On 03/18/2016 01:16 PM, Bernd Schmidt wrote: > > On 03/18/2016 08:14 PM, Jeff Law wrote: > > > I also added a blurb to the dump file when we create these > > > equivalences > > > and included a test to verify the code fires. I verified it > > >

Re: [RFA][PR rtl-optimization/70263] Fix creation of new REG_EQUIV notes

2016-03-19 Thread Jakub Jelinek
On Fri, Mar 18, 2016 at 04:05:08PM -0400, David Malcolm wrote: > On Fri, 2016-03-18 at 13:20 -0600, Jeff Law wrote: > > On 03/18/2016 01:16 PM, Bernd Schmidt wrote: > > > On 03/18/2016 08:14 PM, Jeff Law wrote: > > > > I also added a blurb to the dump file when we create these > > > > equivalences

Re: [RFA][PR rtl-optimization/70263] Fix creation of new REG_EQUIV notes

2016-03-19 Thread Bernd Schmidt
On 03/18/2016 08:14 PM, Jeff Law wrote: I also added a blurb to the dump file when we create these equivalences and included a test to verify the code fires. I verified it fired on x86 and x86-64. It may or may not fire on other targets, so I left the test in the i386 specific subdirectory. T

Re: [RFA][PR rtl-optimization/70263] Fix creation of new REG_EQUIV notes

2016-03-19 Thread Jeff Law
On 03/17/2016 12:23 PM, Bernd Schmidt wrote: On 03/17/2016 06:37 PM, Jeff Law wrote: + bitmap seen_insns; + seen_insns = BITMAP_ALLOC (NULL); You could save an allocation here by making this a bitmap_head and using bitmap_initialize. Done. + bitmap_set_bit (seen_insns, INSN_UID (i

Re: [RFA][PR rtl-optimization/70263] Fix creation of new REG_EQUIV notes

2016-03-19 Thread Jeff Law
On 03/17/2016 12:23 PM, Bernd Schmidt wrote: On 03/17/2016 06:37 PM, Jeff Law wrote: + bitmap seen_insns; + seen_insns = BITMAP_ALLOC (NULL); You could save an allocation here by making this a bitmap_head and using bitmap_initialize. + bitmap_set_bit (seen_insns, INSN_UID (insn)); +

Re: [RFA][PR rtl-optimization/70263] Fix creation of new REG_EQUIV notes

2016-03-19 Thread Jeff Law
On 03/17/2016 02:02 PM, Jeff Law wrote: On 03/17/2016 12:23 PM, Bernd Schmidt wrote: On 03/17/2016 06:37 PM, Jeff Law wrote: + bitmap seen_insns; + seen_insns = BITMAP_ALLOC (NULL); You could save an allocation here by making this a bitmap_head and using bitmap_initialize. + bitmap_

Re: [RFA][PR rtl-optimization/70263] Fix creation of new REG_EQUIV notes

2016-03-19 Thread Bernd Schmidt
On 03/17/2016 06:37 PM, Jeff Law wrote: + bitmap seen_insns; + seen_insns = BITMAP_ALLOC (NULL); You could save an allocation here by making this a bitmap_head and using bitmap_initialize. + bitmap_set_bit (seen_insns, INSN_UID (insn)); + if (! INSN_P (insn)) continue

Re: [RFA][PR rtl-optimization/70263] Fix creation of new REG_EQUIV notes

2016-03-19 Thread Jeff Law
On 03/17/2016 12:23 PM, Bernd Schmidt wrote: On 03/17/2016 06:37 PM, Jeff Law wrote: + bitmap seen_insns; + seen_insns = BITMAP_ALLOC (NULL); You could save an allocation here by making this a bitmap_head and using bitmap_initialize. I guess so, but it's one allocation per compiled function

Re: [RFA][PR rtl-optimization/70263] Fix creation of new REG_EQUIV notes

2016-03-18 Thread Jeff Law
On 03/18/2016 01:16 PM, Bernd Schmidt wrote: On 03/18/2016 08:14 PM, Jeff Law wrote: I also added a blurb to the dump file when we create these equivalences and included a test to verify the code fires. I verified it fired on x86 and x86-64. It may or may not fire on other targets, so I left t