------- 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 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19097