i965/fs: Fix compute_to_mrf() to coalesce VGRFs initialized by multiple single-GRF...
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 27 May 2016 23:03:34 +0000 (16:03 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 31 May 2016 22:57:41 +0000 (15:57 -0700)
commit4fe4f6e8a776acc60633809693e4135f5c894aa3
treeb7370ae732d799b975191edf2fdaff20a3a37270
parent1898673f586b9110fb2a3125e2781cbb1d795c73
i965/fs: Fix compute_to_mrf() to coalesce VGRFs initialized by multiple single-GRF writes.

Which requires using a bitset instead of a boolean flag to keep track
of the GRFs we've seen a generating instruction for already.  The
search loop continues until all instructions initializing the value of
the source VGRF have been found, or it is determined that coalescing
is not possible.

Fixes a few piglit test cases on Gen4-6 which were regressed by
6956015aa514f2d06d0e4b33bfe6bca83142fbf0 due to the different (yet
perfectly valid) ordering in which copy instructions are emitted now
by the simd lowering pass, which had the side effect of causing this
optimization pass to start corrupting the program in cases where a
VGRF-to-MRF copy instruction would be eliminated but only the last
instruction writing to the source VGRF region would be rewritten to
point to the target MRF.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_fs.cpp