[mini] Eliminate some sources of quadratic behavior. Improves on #7809. (#9100)
* [mini] Change region formation pivot from BB to EH clause.
The original BB region computation would loop all BBs and search which EH clause each of them.
EH search is implemented as a linear search, meaning performance was count(BB) * count(clauses).
Since each clause generates at least one BB, it's quadratic on the number of clauses.
Degenerate methods, with tens of thousands of EH clauses, would lead to minutes of JIT time.
New code loops over the clauses and mark all BBs covered by each of them. Given EH ranges are a much
smaller subset of all BBs, this performs significantly better. It remains possible to construct methods
that leads to degenerate compilation times, but it's less likely now.
* [mini] Bound the size of a linked list during liveness.
The `visited` linked list can grown to tens of thousands of entries with some degenerate methods.
This change uses a stack allocated array and switches to a hashtable on overflow.
* [mini] Change printf to g_print
* [mini][amd64] Limit more precise branch target optimization based on number of basic blocks.
On amd64 we update branch target data before each BB is emitted. This has quadratic behavior on number of basic blocks
and can lead to excessive compilation times in degenerate cases.
Limit the increased precision to methods with less than 800 basic blocks.
Reduces compilation time of #7809 by 88% (from 44s to 5s).