aco: don't reorder barriers in the scheduler
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 1 May 2020 10:04:27 +0000 (11:04 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 28 May 2020 10:34:03 +0000 (10:34 +0000)
Unless we're reordering it around a barrier of the same type

No shader-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4880>

src/amd/compiler/aco_scheduler.cpp

index c1d4e9b3ce8a351d5442c82b85f10a71b7b52f8a..cb22491bf64a1b5a2c58b553d591e26ec89c7cda 100644 (file)
@@ -484,7 +484,10 @@ HazardResult perform_hazard_query(hazard_query *query, Instruction *instr)
        instr->opcode == aco_opcode::s_setprio)
       return hazard_fail_unreorderable;
 
-   if (query->barrier_interaction && (query->barrier_interaction & parse_barrier(instr)))
+   barrier_interaction bar = parse_barrier(instr);
+   if (query->barrier_interaction && (query->barrier_interaction & bar))
+      return hazard_fail_barrier;
+   if (bar && query->barriers && (query->barriers & ~bar))
       return hazard_fail_barrier;
    if (query->barriers && (query->barriers & get_barrier_interaction(instr)))
       return hazard_fail_barrier;