https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108738
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- So it's now better than before but still quadratic. Finding a strathegic place to limit the search with some --param might be a solution, but there's no easy point to hook that into. You'd not want to disable the whole pass but terminate the greedy search and axe the candidates sofar processed (to not run into the same ones again), which might then result in "odd" STV decisions if the remains are picked up. To avoid this maybe maintain a "too big" set of candidates and if a further greedy search lands at a insn in that set, axe that search as well. Note it's not the size of the set but the complexity of the search that needs limiting, so count the number of ref visits through analyze_register_chain for an invocation of scalar_chain::build and limit that to some --param. I'm trying to prototype that.