[Bug rtl-optimization/19097] [4.1/4.2 regression] Quadratic behavior with many sets for the same register in VRP

amylaar at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Aug 24 20:50:00 GMT 2006

------- Comment #40 from amylaar at gcc dot gnu dot org  2006-08-24 20:50 -------
(In reply to comment #37)
> For a proper patch, the number should of course be a PARAM and I think using
> bitmap_count_bits penalizes the common case too much (walking the whole bitmap
> is cache expensive even for small bitmaps).

How about:

 -  if (vr && vr->equiv)
 +  if (vr && vr->equiv && vr->equiv->first
        && (!vr->equiv->first->next
            || bitmap_count_bits (vr->equiv) < VRP_EQUIVALENCE_THRESHOLD)))
      bitmap_ior_into (equiv, vr->equiv);

The 0 bit case is sped up, and the 1 bit case is guaranteed to only need two
pointer dereferences to check that there are not too many bits.
Other small bit numbers should still have a high likelyhood to he handled
without a bitmap_count_bits call.
The quick & dirty check might allow more than VRP_EQUIVALENCE_THRESHOLD
bits through if they are tightly packed, but that is still imited to 64
for a host with 32 bit longs, 128 for a host with 64 bit longs.


amylaar at gcc dot gnu dot org changed:

           What    |Removed                     |Added
                 CC|                            |amylaar at gcc dot gnu dot
                   |                            |org


More information about the Gcc-bugs mailing list