nir/lower_vec_to_movs: Better report channels handled by insert_mov
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 10 Feb 2016 20:07:49 +0000 (12:07 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 11 Feb 2016 00:33:14 +0000 (16:33 -0800)
commit70dff4a55e767de8b9ce10f055b94ebb1f6a9755
tree6cd71ab1cb582c639a1bcbf1159d243175b521c0
parent6ee1c386fe8c9b45746e5bbb8a6f9b56da45fd50
nir/lower_vec_to_movs: Better report channels handled by insert_mov

This fixes two issues.  First, we had a use-after-free in the case where
the instruction got deleted and we tried to return mov->dest.write_mask.
Second, in the case where we are doing a self-mov of a register, we delete
those channels that are moved to themselves from the write-mask.  This
means that those channels aren't reported as being handled even though they
are.  We now stash off the write-mask before remove unneeded channels so
that they still get reported as handled.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94073
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
src/compiler/nir/nir_lower_vec_to_movs.c