intel/compiler: Mark virtual_grf_interferes and vars_interfere as const
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 10 Mar 2016 01:44:55 +0000 (17:44 -0800)
committerMatt Turner <mattst88@gmail.com>
Fri, 6 Mar 2020 18:20:41 +0000 (10:20 -0800)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4012>

src/intel/compiler/brw_fs.h
src/intel/compiler/brw_fs_live_variables.cpp
src/intel/compiler/brw_fs_live_variables.h
src/intel/compiler/brw_vec4.h
src/intel/compiler/brw_vec4_live_variables.cpp

index ee04eba52cf93d09fe8e085b9bc04a157c852362..46bf679852db7d6cf8dc1f0d3748c887337f37fd 100644 (file)
@@ -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,
index cd19f41eab4acf079dde32ec25c0b62e2fb83a9b..5c4f3a1c59ba53a1c9cb79dc782b6c242a392030 100644 (file)
@@ -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]);
index cdf48d004762af7d039ac9b833711c2fb47b3809..65220f58d3053de01874e155ffdc393e6e98660e 100644 (file)
@@ -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 &reg) const
    {
       return var_from_vgrf[reg.nr] + reg.offset / REG_SIZE;
index fb44372f2dd73678a18fd3be7400fd1a881d115a..606c31da8330e966f81cf68b46ec97bd10d315ac 100644 (file)
@@ -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);
index 74d0f3bd028b3750f9d5022d85e8a0f0ee134c17..77d685647c40b9c14d1a7ef39a5535414924a467 100644 (file)
@@ -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])) ||