i965: Use foreach_in_list_reverse_safe() macro.
authorMatt Turner <mattst88@gmail.com>
Mon, 15 Feb 2016 06:28:51 +0000 (22:28 -0800)
committerMatt Turner <mattst88@gmail.com>
Sun, 13 Mar 2016 03:23:50 +0000 (19:23 -0800)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp

index 4f97577515ab8fbc7237740e6368d4bad4f71bae..5b54b51395c405de5bcaea4b4b80700964e3728d 100644 (file)
@@ -1057,12 +1057,7 @@ fs_instruction_scheduler::calculate_deps()
    last_accumulator_write = NULL;
    last_fixed_grf_write = NULL;
 
-   exec_node *node;
-   exec_node *prev;
-   for (node = instructions.get_tail(), prev = node->prev;
-        !node->is_head_sentinel();
-        node = prev, prev = node->prev) {
-      schedule_node *n = (schedule_node *)node;
+   foreach_in_list_reverse_safe(schedule_node, n, &instructions) {
       fs_inst *inst = (fs_inst *)n->inst;
 
       /* write-after-read deps. */
@@ -1284,12 +1279,7 @@ vec4_instruction_scheduler::calculate_deps()
    last_accumulator_write = NULL;
    last_fixed_grf_write = NULL;
 
-   exec_node *node;
-   exec_node *prev;
-   for (node = instructions.get_tail(), prev = node->prev;
-        !node->is_head_sentinel();
-        node = prev, prev = node->prev) {
-      schedule_node *n = (schedule_node *)node;
+   foreach_in_list_reverse_safe(schedule_node, n, &instructions) {
       vec4_instruction *inst = (vec4_instruction *)n->inst;
 
       /* write-after-read deps. */