On 10/4/21 4:15 AM, Richard Biener via Gcc-patches wrote:
On Mon, Oct 4, 2021 at 8:55 AM Aldy Hernandez via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
The m_ranges[] field in int_range<N> are trees, so they live in GC
space. Since invalid_range is static, it must be marked with GTY
magic. However, calculating invalid_range is not particularly slow,
or on a critical path, so we can just put it in local scope and
recalculate every time.
Tested on x86-64 Linux.
Since this is more of a GC thing than a range thing, I'd like a nod from
a global reviewer.
OK?
OK, but can we somehow make int_range<>::intersect work
with non-tree as well? That is, can we somehow make this
operation w/o constructing temporary trees?
Thanks,
Richard.
Yeah, I'll shortly provide an intersect which takes 2 wide_ints, along
with some other performance improvements.
It can be more efficient since the general case has to build into a
temporary range, and if its single pair, we can go directly into the
original range, and possible even avoid ever creating a new tree.
Andrew