From 10489b418c6d0ec045fdc8eaa76d0f8ae413d73c Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Wed, 3 Jan 2024 13:49:58 -0800 Subject: [PATCH] intel/brw: Pull bank_conflicts out of fs_visitor Reviewed-by: Lionel Landwerlin Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_fs.cpp | 2 +- src/intel/compiler/brw_fs.h | 2 +- src/intel/compiler/brw_fs_bank_conflicts.cpp | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index bec7a0ba485..627a2115b8b 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -6271,7 +6271,7 @@ fs_visitor::allocate_registers(bool allow_spilling) if (failed) return; - opt_bank_conflicts(); + brw_fs_opt_bank_conflicts(*this); schedule_instructions_post_ra(); diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h index 97cc3bc4fdd..26e0961e646 100644 --- a/src/intel/compiler/brw_fs.h +++ b/src/intel/compiler/brw_fs.h @@ -270,7 +270,6 @@ public: bool opt_algebraic(); bool opt_redundant_halt(); - bool opt_bank_conflicts(); bool opt_split_sends(); bool register_coalesce(); bool eliminate_find_live_channel(); @@ -619,6 +618,7 @@ bool brw_lower_dpas(fs_visitor &v); void nir_to_brw(fs_visitor *s); +bool brw_fs_opt_bank_conflicts(fs_visitor &s); bool brw_fs_opt_cmod_propagation(fs_visitor &s); bool brw_fs_opt_combine_constants(fs_visitor &s); bool brw_fs_opt_copy_propagation(fs_visitor &s); diff --git a/src/intel/compiler/brw_fs_bank_conflicts.cpp b/src/intel/compiler/brw_fs_bank_conflicts.cpp index 8505748b0f8..f611a8a81b5 100644 --- a/src/intel/compiler/brw_fs_bank_conflicts.cpp +++ b/src/intel/compiler/brw_fs_bank_conflicts.cpp @@ -907,27 +907,27 @@ namespace { } bool -fs_visitor::opt_bank_conflicts() +brw_fs_opt_bank_conflicts(fs_visitor &s) { - assert(grf_used || !"Must be called after register allocation"); + assert(s.grf_used || !"Must be called after register allocation"); /* TODO: Re-work this pass for Gfx20+. */ - if (devinfo->ver >= 20) + if (s.devinfo->ver >= 20) return false; /* No ternary instructions -- No bank conflicts. */ - if (devinfo->ver < 6) + if (s.devinfo->ver < 6) return false; - const partitioning p = shader_reg_partitioning(this); - const bool *constrained = shader_reg_constraints(this, p); + const partitioning p = shader_reg_partitioning(&s); + const bool *constrained = shader_reg_constraints(&s, p); const weight_vector_type *conflicts = - shader_conflict_weight_matrix(this, p); + shader_conflict_weight_matrix(&s, p); const permutation map = optimize_reg_permutation(p, constrained, conflicts, identity_reg_permutation(p)); - foreach_block_and_inst(block, fs_inst, inst, cfg) { + foreach_block_and_inst(block, fs_inst, inst, s.cfg) { inst->dst = transform(p, map, inst->dst); for (int i = 0; i < inst->sources; i++)