From dc33a8fb06fcbe9797fb1cbc62ce8cb5986fb8f3 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Wed, 3 Jan 2024 11:00:59 -0800 Subject: [PATCH] intel/brw: Pull opt_cmod_propagation 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_cmod_propagation.cpp | 10 +++++----- src/intel/compiler/test_fs_cmod_propagation.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index dd52dfe7959..7b2e6733b87 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -5681,7 +5681,7 @@ fs_visitor::optimize() OPT(opt_cse); OPT(brw_fs_opt_copy_propagation, *this); OPT(opt_predicated_break, this); - OPT(opt_cmod_propagation); + OPT(brw_fs_opt_cmod_propagation, *this); OPT(dead_code_eliminate); OPT(opt_peephole_sel); OPT(dead_control_flow_eliminate, this); diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h index 8539ee66dea..b723c511ea1 100644 --- a/src/intel/compiler/brw_fs.h +++ b/src/intel/compiler/brw_fs.h @@ -306,7 +306,6 @@ public: void emit_interpolation_setup_gfx6(); bool opt_peephole_sel(); bool opt_saturate_propagation(); - bool opt_cmod_propagation(); bool opt_zero_samples(); void set_tcs_invocation_id(); @@ -625,6 +624,7 @@ bool brw_lower_dpas(fs_visitor &v); void nir_to_brw(fs_visitor *s); +bool brw_fs_opt_cmod_propagation(fs_visitor &s); bool brw_fs_opt_copy_propagation(fs_visitor &s); #endif /* BRW_FS_H */ diff --git a/src/intel/compiler/brw_fs_cmod_propagation.cpp b/src/intel/compiler/brw_fs_cmod_propagation.cpp index 0fadb402172..ca8ee21f69a 100644 --- a/src/intel/compiler/brw_fs_cmod_propagation.cpp +++ b/src/intel/compiler/brw_fs_cmod_propagation.cpp @@ -550,18 +550,18 @@ opt_cmod_propagation_local(const intel_device_info *devinfo, bblock_t *block) } bool -fs_visitor::opt_cmod_propagation() +brw_fs_opt_cmod_propagation(fs_visitor &s) { bool progress = false; - foreach_block_reverse(block, cfg) { - progress = opt_cmod_propagation_local(devinfo, block) || progress; + foreach_block_reverse(block, s.cfg) { + progress = opt_cmod_propagation_local(s.devinfo, block) || progress; } if (progress) { - cfg->adjust_block_ips(); + s.cfg->adjust_block_ips(); - invalidate_analysis(DEPENDENCY_INSTRUCTIONS); + s.invalidate_analysis(DEPENDENCY_INSTRUCTIONS); } return progress; diff --git a/src/intel/compiler/test_fs_cmod_propagation.cpp b/src/intel/compiler/test_fs_cmod_propagation.cpp index f23c841e931..78d91943e59 100644 --- a/src/intel/compiler/test_fs_cmod_propagation.cpp +++ b/src/intel/compiler/test_fs_cmod_propagation.cpp @@ -118,7 +118,7 @@ cmod_propagation(fs_visitor *v) v->cfg->dump(); } - bool ret = v->opt_cmod_propagation(); + bool ret = brw_fs_opt_cmod_propagation(*v); if (print) { fprintf(stderr, "\n= After =\n");