https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109695
--- Comment #38 from Aldy Hernandez <aldyh at gcc dot gnu.org> --- (In reply to Andrew Macleod from comment #37) > (In reply to CVS Commits from comment #36) > > > For the curious, a particular hot spot for IPA in this area was: > > > > ipcp_vr_lattice::meet_with_1 (const value_range *other_vr) > > { > > ... > > ... > > value_range save (m_vr); > > m_vr.union_ (*other_vr); > > return m_vr != save; > > } > > > > The problem isn't the resizing (since we do that at most once) but the > > fact that for some functions with lots of callers we end up a huge > > range that gets copied and compared for every meet operation. Maybe > > the IPA algorithm could be adjusted somehow??. > > isn't the the same thing as > > return m_vr.union_ (*other_vr); > > which should be much faster without all the copying... ? Indeed. That is in the committed version of the patch. I just forgot to update the message. The reason I didn't originally do as you suggested was that there was a bug in the union code that returned TRUE for a union that hadn't changed anything. That has also been fixed in trunk.