https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68198

--- Comment #6 from Jeffrey A. Law <law at redhat dot com> ---
I see what's happening here (and boy it's much better to be debugging with real
screens and a good night's sleep).

So imagine what happens when you build a thread path and on that path you've
got a block with a large switch statement.  Say on the order of 1k unique
destinations.

Remember that we have to duplicate blocks on the thread path.  For each block
on the path we'll redirect *one* edge to the next block on the path, the
remaining edges are copies from the original block and thus reach targets
outside the thread path.

Yup, given a thread path containing block with ~1k successors, we'll end up
creating ~1k new edges for the duplicated block.  Now imagine we do that a few
hundred times (because the join block at the start of the thread path has
hundreds of predecessors).  Suddenly we're talking about tens of thousands of
edges.

That's what's happening here.

In theory the old threader has the same problem, but it's just not strong
enough to actually find enough paths to show the edge explosion.

Fixing ought to be fairly easy...

Reply via email to