Module: Mesa
Branch: main
Commit: dcb68de6563d511ccf78ed12b76516038e452df4
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=dcb68de6563d511ccf78ed12b76516038e452df4

Author: Caio Oliveira <[email protected]>
Date:   Fri Oct 20 12:16:18 2023 -0700

intel/compiler: Clear up block instructions before re-adding them

Avoids fixing up list pointers that we don't care about anymore -- since
all the instructions will be re-added in a different order anyway.

Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>

---

 src/intel/compiler/brw_schedule_instructions.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_schedule_instructions.cpp 
b/src/intel/compiler/brw_schedule_instructions.cpp
index 9b20431fab2..0855ee9a131 100644
--- a/src/intel/compiler/brw_schedule_instructions.cpp
+++ b/src/intel/compiler/brw_schedule_instructions.cpp
@@ -1861,7 +1861,6 @@ instruction_scheduler::schedule(schedule_node *chosen)
 
    assert(chosen);
    chosen->remove();
-   chosen->inst->exec_node::remove();
    current.block->instructions.push_tail(chosen->inst);
 
    /* If we expected a delay for scheduling, then bump the clock to reflect
@@ -1942,6 +1941,8 @@ fs_instruction_scheduler::schedule_instructions()
          current.available.push_tail(n);
    }
 
+   current.block->instructions.make_empty();
+
    while (!current.available.is_empty()) {
       schedule_node *chosen = choose_instruction_to_schedule();
       schedule(chosen);
@@ -2012,6 +2013,8 @@ vec4_instruction_scheduler::run()
             current.available.push_tail(n);
       }
 
+      current.block->instructions.make_empty();
+
       while (!current.available.is_empty()) {
          schedule_node *chosen = choose_instruction_to_schedule();
          schedule(chosen);

Reply via email to