On 9/25/20 3:18 PM, Richard Biener wrote:
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;
+ }
That's intentional as m_max_case_bit_tests is a very small number (3) and
I want to track *distinct* indices in dest_bbs. So dest_bbs.contains
is a constant operation.
vec::contains is linear search so no. Was this for the length check?
Just do
if (bitmap_set_bit (...))
{
length++;
if (length > ...)
I would need here bitmap_count_bits. Do you prefer it?
Martin
Thanks,
Martin