intel/compiler: initialize remaining fields of various classes

These variables seem to be initialized before being used, so this
patch is not fixing any bug, but leaving them unitialized may become
a bug after some refactoring.

These classes were affected: fs_reg_alloc, fs_visitor, fs_generator,
instruction_scheduler.

Found by Coverity.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6667>
This commit is contained in:
Marcin Ślusarz
2020-09-09 18:13:43 +02:00
committed by Marge Bot
parent 40b964dc8f
commit 5ea0b6a9c6
4 changed files with 13 additions and 2 deletions

View File

@@ -191,9 +191,9 @@ fs_generator::fs_generator(const struct brw_compiler *compiler, void *log_data,
: compiler(compiler), log_data(log_data),
devinfo(compiler->devinfo),
prog_data(prog_data),
prog_data(prog_data), dispatch_width(0),
runtime_check_aads_emit(runtime_check_aads_emit), debug_flag(false),
stage(stage), mem_ctx(mem_ctx)
shader_name(NULL), stage(stage), mem_ctx(mem_ctx)
{
p = rzalloc(mem_ctx, struct brw_codegen);
brw_init_codegen(devinfo, p, mem_ctx);

View File

@@ -429,6 +429,13 @@ public:
/* Get payload IP information */
payload_last_use_ip = ralloc_array(mem_ctx, int, payload_node_count);
node_count = 0;
first_payload_node = 0;
first_mrf_hack_node = 0;
grf127_send_hack_node = 0;
first_vgrf_node = 0;
first_spill_node = 0;
spill_vgrf_ip = NULL;
spill_vgrf_ip_alloc = 0;
spill_node_count = 0;

View File

@@ -950,9 +950,11 @@ fs_visitor::init()
this->prog_data = this->stage_prog_data;
this->failed = false;
this->fail_msg = NULL;
this->nir_locals = NULL;
this->nir_ssa_values = NULL;
this->nir_system_values = NULL;
memset(&this->payload, 0, sizeof(this->payload));
this->source_depth_to_render_target = false;

View File

@@ -544,6 +544,8 @@ public:
this->instructions.make_empty();
this->post_reg_alloc = (mode == SCHEDULE_POST);
this->mode = mode;
this->reg_pressure = 0;
this->block_idx = 0;
if (!post_reg_alloc) {
this->reg_pressure_in = rzalloc_array(mem_ctx, int, block_count);