RPTracker::reset(MI) is a very expensive call when the number of virtual registers is huge.
We observed a long compilation time issue when RPT::reset() is called once for each cluster.
In this work, we call RPT.reset() only at the first seen cluster, and use advance() to get
the register pressure for the later clusters in the same basic block. This could effectively reduce the number
of the expensive calls and thus reduce the compile time.
Note: I am still seeing a couple LIT failures with the current state of this patch.
I am not sure, but likely RPT.getNext().isValid() has the same result as using !InitializedInBlock.