Hello, On Wed, May 17 2023, Aldy Hernandez wrote: > This patch encapsulates the ipa_vr internals into an API. It also > makes it type agnostic, in preparation for upcoming changes to IPA. > > Interestingly, there's a 0.44% improvement to IPA-cp, which I'm sure > we'll soak up with future changes in this area :). > > BTW, there's a note here: > + // vrange_storage is typeless, but we need to know what type of > + // range that is being streamed out (irange, frange, etc). AFAICT, > + // there's no way to get at the underlying type by the time we > + // stream out in write_ipcp_transformation_info. > + tree m_type; > > Could someone more IPA savvy double check this is indeed the case?
Yes, that is true and keeping the type around in ipa_vr is probably easier than postponing the deallocation of parameter descriptors somehow. > > OK for trunk? Yes, thanks. Martin > > gcc/ChangeLog: > > * ipa-cp.cc (ipa_value_range_from_jfunc): Use new ipa_vr API. > (ipcp_store_vr_results): Same. > * ipa-prop.cc (ipa_vr::ipa_vr): New. > (ipa_vr::get_vrange): New. > (ipa_vr::set_unknown): New. > (ipa_vr::streamer_read): New. > (ipa_vr::streamer_write): New. > (write_ipcp_transformation_info): Use new ipa_vr API. > (read_ipcp_transformation_info): Same. > (ipa_vr::nonzero_p): Delete. > (ipcp_update_vr): Use new ipa_vr API. > * ipa-prop.h (class ipa_vr): Provide an API and hide internals. > * ipa-sra.cc (zap_useless_ipcp_results): Use new ipa_vr API. > * gcc.dg/ipa/pr78121.c: Adjust for vrange::dump use. > * gcc.dg/ipa/vrp1.c: Same. > * gcc.dg/ipa/vrp2.c: Same. > * gcc.dg/ipa/vrp3.c: Same. > * gcc.dg/ipa/vrp4.c: Same. > * gcc.dg/ipa/vrp5.c: Same. > * gcc.dg/ipa/vrp6.c: Same. > * gcc.dg/ipa/vrp7.c: Same. > * gcc.dg/ipa/vrp8.c: Same.