[RFC] Issues with intraprocedural devirtualization

Martin Jambor mjambor@suse.cz
Fri Aug 23 15:11:00 GMT 2013


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 will do the job.
> 
> I would like to return the code back eventually to handle arrays&unions
> but that can be done incrementally (and this is not the only place that
> sufers from the problem)
> 
> Martin: I am still not quite certain about the dynamic type changing logic.
> if this is the case ipa-prop needs to deal with and it handles only 0 offsets
> within the outer type, I guess it can just test the offset by itself?

In these cases, devirtualization is done according ipa invariants, no
dynamic type checks are in place, we did away with requiring the
artificial-ness of the field we devirtualize according to.
I believe your new check that the function has not been overridden is
sufficient and superior.

Thanks,

Martin

> 
> Honza
> 
> Bootstrapped/regtested x86_64-linux, OK?
> 
> 	* ipa-cp.c (ipa_get_indirect_edge_target_1): Update use
> 	of gimple_extract_devirt_binfo_from_cst.
> 	* gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Rework.
> 	(gimple_fold_call): Update use of gimple_extract_devirt_binfo_from_cst.
> 	* ipa-prop.c (try_make_edge_direct_virtual_call): Likewise.
> 	* gimple.h (gimple_extract_devirt_binfo_from_cst): Update.



More information about the Gcc-patches mailing list