From 3ceb496cdf5ef0ccc79e71c8fb856535501a9446 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 9 Mar 2016 17:44:55 -0800 Subject: [PATCH] intel/compiler: Mark virtual_grf_interferes and vars_interfere as const Reviewed-by: Matt Turner Part-of: --- src/intel/compiler/brw_fs.h | 2 +- src/intel/compiler/brw_fs_live_variables.cpp | 4 ++-- src/intel/compiler/brw_fs_live_variables.h | 2 +- src/intel/compiler/brw_vec4.h | 2 +- src/intel/compiler/brw_vec4_live_variables.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h index ee04eba52cf..46bf679852d 100644 --- a/src/intel/compiler/brw_fs.h +++ b/src/intel/compiler/brw_fs.h @@ -151,7 +151,7 @@ public: bool remove_extra_rounding_modes(); bool opt_sampler_eot(); - bool virtual_grf_interferes(int a, int b); + bool virtual_grf_interferes(int a, int b) const; void schedule_instructions(instruction_scheduler_mode mode); void insert_gen4_send_dependency_workarounds(); void insert_gen4_pre_send_dependency_workarounds(bblock_t *block, diff --git a/src/intel/compiler/brw_fs_live_variables.cpp b/src/intel/compiler/brw_fs_live_variables.cpp index cd19f41eab4..5c4f3a1c59b 100644 --- a/src/intel/compiler/brw_fs_live_variables.cpp +++ b/src/intel/compiler/brw_fs_live_variables.cpp @@ -352,14 +352,14 @@ fs_visitor::calculate_live_intervals() } bool -fs_live_variables::vars_interfere(int a, int b) +fs_live_variables::vars_interfere(int a, int b) const { return !(end[b] <= start[a] || end[a] <= start[b]); } bool -fs_visitor::virtual_grf_interferes(int a, int b) +fs_visitor::virtual_grf_interferes(int a, int b) const { return !(virtual_grf_end[a] <= virtual_grf_start[b] || virtual_grf_end[b] <= virtual_grf_start[a]); diff --git a/src/intel/compiler/brw_fs_live_variables.h b/src/intel/compiler/brw_fs_live_variables.h index cdf48d00476..65220f58d30 100644 --- a/src/intel/compiler/brw_fs_live_variables.h +++ b/src/intel/compiler/brw_fs_live_variables.h @@ -81,7 +81,7 @@ public: fs_live_variables(fs_visitor *v, const cfg_t *cfg); ~fs_live_variables(); - bool vars_interfere(int a, int b); + bool vars_interfere(int a, int b) const; int var_from_reg(const fs_reg ®) const { return var_from_vgrf[reg.nr] + reg.offset / REG_SIZE; diff --git a/src/intel/compiler/brw_vec4.h b/src/intel/compiler/brw_vec4.h index fb44372f2dd..606c31da833 100644 --- a/src/intel/compiler/brw_vec4.h +++ b/src/intel/compiler/brw_vec4.h @@ -145,7 +145,7 @@ public: bool dead_code_eliminate(); int var_range_start(unsigned v, unsigned n) const; int var_range_end(unsigned v, unsigned n) const; - bool virtual_grf_interferes(int a, int b); + bool virtual_grf_interferes(int a, int b) const; bool opt_cmod_propagation(); bool opt_copy_propagation(bool do_constant_prop = true); bool opt_cse_local(bblock_t *block); diff --git a/src/intel/compiler/brw_vec4_live_variables.cpp b/src/intel/compiler/brw_vec4_live_variables.cpp index 74d0f3bd028..77d685647c4 100644 --- a/src/intel/compiler/brw_vec4_live_variables.cpp +++ b/src/intel/compiler/brw_vec4_live_variables.cpp @@ -335,7 +335,7 @@ vec4_visitor::var_range_end(unsigned v, unsigned n) const } bool -vec4_visitor::virtual_grf_interferes(int a, int b) +vec4_visitor::virtual_grf_interferes(int a, int b) const { return !((var_range_end(8 * alloc.offsets[a], 8 * alloc.sizes[a]) <= var_range_start(8 * alloc.offsets[b], 8 * alloc.sizes[b])) || -- 2.30.2