diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h index cc0101e1899..07fb278d5e5 100644 --- a/src/intel/compiler/brw_fs.h +++ b/src/intel/compiler/brw_fs.h @@ -263,8 +263,6 @@ public: bool opt_cse_local(const brw::fs_live_variables &live, bblock_t *block, int &ip); bool opt_copy_propagation(); - bool try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry); - bool try_constant_propagate(fs_inst *inst, acp_entry *entry); bool opt_copy_propagation_local(void *mem_ctx, bblock_t *block, exec_list *acp); bool opt_register_renaming(); diff --git a/src/intel/compiler/brw_fs_copy_propagation.cpp b/src/intel/compiler/brw_fs_copy_propagation.cpp index 00443e0161c..1a777e0df15 100644 --- a/src/intel/compiler/brw_fs_copy_propagation.cpp +++ b/src/intel/compiler/brw_fs_copy_propagation.cpp @@ -542,12 +542,16 @@ instruction_requires_packed_data(fs_inst *inst) } } -bool -fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry) +static bool +try_copy_propagate(const brw_compiler *compiler, fs_inst *inst, + acp_entry *entry, int arg, + const brw::simple_allocator &alloc) { if (inst->src[arg].file != VGRF) return false; + const struct intel_device_info *devinfo = compiler->devinfo; + if (entry->src.file == IMM) return false; assert(entry->src.file == VGRF || entry->src.file == UNIFORM || @@ -814,9 +818,11 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry) } -bool -fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry) +static bool +try_constant_propagate(const brw_compiler *compiler, fs_inst *inst, + acp_entry *entry) { + const struct intel_device_info *devinfo = compiler->devinfo; bool progress = false; if (entry->src.file != IMM) @@ -1181,10 +1187,10 @@ fs_visitor::opt_copy_propagation_local(void *copy_prop_ctx, bblock_t *block, continue; foreach_in_list(acp_entry, entry, &acp[inst->src[i].nr % ACP_HASH_SIZE]) { - if (try_constant_propagate(inst, entry)) { + if (try_constant_propagate(compiler, inst, entry)) { progress = true; break; - } else if (try_copy_propagate(inst, i, entry)) { + } else if (try_copy_propagate(compiler, inst, entry, i, alloc)) { progress = true; break; }