On Fri, Sep 25, 2020 at 11:13 AM Martin Liška <mli...@suse.cz> wrote:
>
> Hello.
>
> All right, I come up with a rapid speed up that can allow us to remove
> the introduced parameter. It contains 2 parts:
> - BIT TEST: we allow at maximum a range that is smaller GET_MODE_BITSIZE
> - JT: we spent quite some time in density calculation, we can guess it first
>    and it leads to a fast bail out.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?

Err

+  auto_vec<int> dest_bbs;
-  auto_bitmap dest_bbs;

-      bitmap_set_bit (dest_bbs, sc->m_case_bb->index);
+      if (!dest_bbs.contains (sc->m_case_bb->index))
+       {
+         dest_bbs.safe_push (sc->m_case_bb->index);
+         if (dest_bbs.length () > m_max_case_bit_tests)
+           return false;
+       }

vec::contains is linear search so no.  Was this for the length check?
Just do

     if (bitmap_set_bit (...))
      {
        length++;
        if (length > ...)

> Thanks,
> Martin

Reply via email to