Re: [RFC] Issues with intraprocedural devirtualization

2013-08-23 Thread Martin Jambor
Hi, On Mon, Aug 19, 2013 at 11:10:31AM +0200, Jan Hubicka wrote: > Hi, > here is variant of patch that drops the field walking from > gimple_extract_devirt_binfo_from_cst completely. As pointed out > by Jason, it is pointless since all structures have BINFO in C++ > and thus get_binfo_at_offset wi

Re: [RFC] Issues with intraprocedural devirtualization

2013-08-23 Thread Jan Hubicka
> Hi, > I went through some statistics on firefox build (it is a source combining > many coding styles). > I was basically curious where we do devirtualization. The result is: > > Before inline (i.e. important devirtualization) > 624 ssa-pre devirt 0 > this is interaprocedural deviru

Re: [RFC] Issues with intraprocedural devirtualization

2013-08-22 Thread Jan Hubicka
Hi, I went through some statistics on firefox build (it is a source combining many coding styles). I was basically curious where we do devirtualization. The result is: Before inline (i.e. important devirtualization) 624 ssa-pre devirt 0 this is interaprocedural devirutalization happe

Re: [RFC] Issues with intraprocedural devirtualization

2013-08-19 Thread Jan Hubicka
Hi, here is variant of patch that drops the field walking from gimple_extract_devirt_binfo_from_cst completely. As pointed out by Jason, it is pointless since all structures have BINFO in C++ and thus get_binfo_at_offset will do the job. I would like to return the code back eventually to handle ar

Re: [RFC] Issues with intraprocedural devirtualization

2013-08-18 Thread Jan Hubicka
> > On 08/17/2013 05:44 PM, Jan Hubicka wrote: > > > 1) we want the type to not have base because we may have inlined the > > > constructor. > > > During construction the vtables are filled by base's vtable and thus > > > we can > > > not simply devirtualize based on the final virtual ta

Re: [RFC] Issues with intraprocedural devirtualization

2013-08-18 Thread Jan Hubicka
> On 08/17/2013 05:44 PM, Jan Hubicka wrote: > > 1) we want the type to not have base because we may have inlined the > > constructor. > > During construction the vtables are filled by base's vtable and thus we > > can > > not simply devirtualize based on the final virtual table without

Re: [RFC] Issues with intraprocedural devirtualization

2013-08-17 Thread Richard Biener
Jason Merrill wrote: >On 08/17/2013 05:44 PM, Jan Hubicka wrote: >> 1) we want the type to not have base because we may have inlined >the constructor. >> During construction the vtables are filled by base's vtable and >thus we can >> not simply devirtualize based on the final virtual t

Re: [RFC] Issues with intraprocedural devirtualization

2013-08-17 Thread Gabriel Dos Reis
On Sat, Aug 17, 2013 at 7:56 PM, Jason Merrill wrote: >> I do not know if one can do >> something like having automatic variable of class A and use placement new >> to change it to class B. > > > This is something of a grey area in the standard, with a few defect reports > yet to be resolved. I

Re: [RFC] Issues with intraprocedural devirtualization

2013-08-17 Thread Jason Merrill
On 08/17/2013 05:44 PM, Jan Hubicka wrote: 1) we want the type to not have base because we may have inlined the constructor. During construction the vtables are filled by base's vtable and thus we can not simply devirtualize based on the final virtual table without proving that

[RFC] Issues with intraprocedural devirtualization

2013-08-17 Thread Jan Hubicka
Hi, this patch tries to make gimple_extract_devirt_binfo_from_cst little bit more sane and make it match bit more cases. Currently we seem to be able to devirtualize only if the type in question has no basetypes (not even some not having virtual methods at all) and it is the initial type implement