intel/fs: Make try_constant_propagate and try_copy_propagate file private

This annoyed me durning development of this MR. Every time I changed the
parameters to this internal function, I had to modify a public header
file... and trigger a much large rebuild.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
This commit is contained in:
Ian Romanick
2023-03-15 09:27:36 -07:00
committed by Marge Bot
parent 8665e37960
commit b5b2338c5c
2 changed files with 12 additions and 8 deletions

View File

@@ -263,8 +263,6 @@ public:
bool opt_cse_local(const brw::fs_live_variables &live, bblock_t *block, int &ip); bool opt_cse_local(const brw::fs_live_variables &live, bblock_t *block, int &ip);
bool opt_copy_propagation(); 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, bool opt_copy_propagation_local(void *mem_ctx, bblock_t *block,
exec_list *acp); exec_list *acp);
bool opt_register_renaming(); bool opt_register_renaming();

View File

@@ -542,12 +542,16 @@ instruction_requires_packed_data(fs_inst *inst)
} }
} }
bool static bool
fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry) 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) if (inst->src[arg].file != VGRF)
return false; return false;
const struct intel_device_info *devinfo = compiler->devinfo;
if (entry->src.file == IMM) if (entry->src.file == IMM)
return false; return false;
assert(entry->src.file == VGRF || entry->src.file == UNIFORM || 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 static bool
fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry) try_constant_propagate(const brw_compiler *compiler, fs_inst *inst,
acp_entry *entry)
{ {
const struct intel_device_info *devinfo = compiler->devinfo;
bool progress = false; bool progress = false;
if (entry->src.file != IMM) if (entry->src.file != IMM)
@@ -1181,10 +1187,10 @@ fs_visitor::opt_copy_propagation_local(void *copy_prop_ctx, bblock_t *block,
continue; continue;
foreach_in_list(acp_entry, entry, &acp[inst->src[i].nr % ACP_HASH_SIZE]) { 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; progress = true;
break; break;
} else if (try_copy_propagate(inst, i, entry)) { } else if (try_copy_propagate(compiler, inst, entry, i, alloc)) {
progress = true; progress = true;
break; break;
} }