intel/fs: Properly stride NULL replacement regs in DCE
authorJason Ekstrand <jason@jlekstrand.net>
Sat, 13 Jul 2019 17:06:00 +0000 (12:06 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 17 Jul 2019 18:44:35 +0000 (18:44 +0000)
This fixes some validation errors generated by certain D->W conversions
but is likely not a full solution.  Calculating an actual register
stride is a far more complex problem in general and should probably be
handled by the brw_fs_generator.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/intel/compiler/brw_fs_dead_code_eliminate.cpp

index 38ae1d41a6ad65fecf603f0d3e1bcd6fd85ac13a..f3d510d36d0567a4e39623b3943964d51a147ae8 100644 (file)
@@ -96,7 +96,8 @@ fs_visitor::dead_code_eliminate()
 
             if (!result_live &&
                 (can_omit_write(inst) || can_eliminate(inst, flag_live))) {
-               inst->dst = fs_reg(retype(brw_null_reg(), inst->dst.type));
+               inst->dst = fs_reg(spread(retype(brw_null_reg(), inst->dst.type),
+                                         inst->dst.stride));
                progress = true;
             }
          }