Mesa (master): i965/fs: Remove start/end aliases in compute_live_intervals( ).

Eric Anholt anholt at kemper.freedesktop.org
Thu Oct 10 23:30:15 UTC 2013


Module: Mesa
Branch: master
Commit: 939b0f2c2ff41869fce8c99986607f5daf67b63a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=939b0f2c2ff41869fce8c99986607f5daf67b63a

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Aug  6 18:32:55 2013 -0700

i965/fs: Remove start/end aliases in compute_live_intervals().

In compute_live_intervals(), start and end are shorter names for
the virtual_grf_start and virtual_grf_end class members.

Now that the fs_live_intervals class has arrays named start and end
which are indexed by var, rather than VGRF, reusing the name is
confusing.  Plus, most of the code has been factored out, so using the
long names isn't as inconvenient.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 .../drivers/dri/i965/brw_fs_live_variables.cpp     |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
index a07565c..497a0db 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
@@ -310,16 +310,14 @@ fs_visitor::calculate_live_intervals()
       return;
 
    int num_vgrfs = this->virtual_grf_count;
-   int *start = ralloc_array(mem_ctx, int, num_vgrfs);
-   int *end = ralloc_array(mem_ctx, int, num_vgrfs);
    ralloc_free(this->virtual_grf_start);
    ralloc_free(this->virtual_grf_end);
-   this->virtual_grf_start = start;
-   this->virtual_grf_end = end;
+   virtual_grf_start = ralloc_array(mem_ctx, int, num_vgrfs);
+   virtual_grf_end = ralloc_array(mem_ctx, int, num_vgrfs);
 
    for (int i = 0; i < num_vgrfs; i++) {
-      start[i] = MAX_INSTRUCTION;
-      end[i] = -1;
+      virtual_grf_start[i] = MAX_INSTRUCTION;
+      virtual_grf_end[i] = -1;
    }
 
    cfg_t cfg(this);
@@ -328,8 +326,8 @@ fs_visitor::calculate_live_intervals()
    /* Merge the per-component live ranges to whole VGRF live ranges. */
    for (int i = 0; i < livevars.num_vars; i++) {
       int vgrf = livevars.vgrf_from_var[i];
-      start[vgrf] = MIN2(start[vgrf], livevars.start[i]);
-      end[vgrf] = MAX2(end[vgrf], livevars.end[i]);
+      virtual_grf_start[vgrf] = MIN2(virtual_grf_start[vgrf], livevars.start[i]);
+      virtual_grf_end[vgrf] = MAX2(virtual_grf_end[vgrf], livevars.end[i]);
    }
 
    this->live_intervals_valid = true;




More information about the mesa-commit mailing list