[Mesa-dev] [PATCH] i965: Invalidate virtual register information after register allocation.

Matt Turner mattst88 at gmail.com
Tue Jun 9 17:49:43 PDT 2015


On Tue, Jun 9, 2015 at 5:23 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> Connor and I have both hit bugs where code (such as dump_instructions())
> attempts to use live intervals or VGRF information, and wasted a bunch
> of time trying to debug that.
>
> By freeing the arrays and zeroing the counts, we make any array access
> out of bounds, which results in an obvious problem that's easy to
> uncover with Valgrind, rather than subtle bugs.

That seems fine... but the first two statements in
fs_visitor::calculate_register_pressure() are

   invalidate_live_intervals();
   calculate_live_intervals();

I don't think calculate_live_intervals() will go anything good if
we've already allocated registers, so what is the goal? To simply make
recognizing the explosion caused by calling dump_instructions() after
RA easier?

If we don't have a flag signifying that we've already colored
registers, maybe we should add one and use it to avoid the
live_intervals stuff in dump_instructions(), and maybe assert that
it's false in calculate_live_intervals() as well?


More information about the mesa-dev mailing list