nir/loop_unroll: Fix out-of-bounds access handling
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 12 Mar 2019 21:25:39 +0000 (16:25 -0500)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 13 Mar 2019 02:06:39 +0000 (21:06 -0500)
commit83fdefc06287f6c8bbb3bb5bb4ccd36d653017a3
treed2da41ff177001925b2a8d0187b9d5c0766034d2
parentc056609c439da964db8344a8fde66aec4bd9c877
nir/loop_unroll: Fix out-of-bounds access handling

The previous code was completely broken when it came to constructing the
undef values.  I'm not sure how it ever worked.  For the case of a copy
that reads an undefined value, we can just delete the copy because the
destination is a valid undefined value.  This saves us the effort of
trying to construct a value for an arbitrary copy_deref intrinsic.

Fixes: e8a8937a04 "nir: add partial loop unrolling support"
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/nir/nir_opt_loop_unroll.c