Mesa (master): ir3: prevent duplication of instruction's dependencies

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 4 11:08:38 UTC 2021


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

Author: Danylo Piliaiev <dpiliaiev at igalia.com>
Date:   Wed Mar  3 12:08:53 2021 +0200

ir3: prevent duplication of instruction's dependencies

Otherwise mark_kill_path() is happy to take exponential time to finish.

It was possible to have such chains:
  ...
 stib.base0 imm[0.000000,0,0x0], ssa_233, ssa_234, false-deps:ssa_231, ssa_231
 stib.base0 imm[0.000000,0,0x0], ssa_237, ssa_238, false-deps:ssa_235, ssa_235
 stib.base0 imm[0.000000,0,0x0], ssa_241, ssa_242, false-deps:ssa_239, ssa_239
 stib.base0 imm[0.000000,0,0x0], ssa_245, ssa_246, false-deps:ssa_243, ssa_243
 stib.base0 imm[0.000000,0,0x0], ssa_249, ssa_250, false-deps:ssa_247, ssa_247
 stib.base0 imm[0.000000,0,0x0], ssa_105, ssa_253, false-deps:ssa_251, ssa_251
 stib.base0 imm[0.000000,0,0x0], ssa_109, ssa_256, false-deps:ssa_254, ssa_254
 stib.base0 imm[0.000000,0,0x0], ssa_113, ssa_259, false-deps:ssa_257, ssa_257
 stib.base0 imm[0.000000,0,0x0], ssa_117, ssa_262, false-deps:ssa_260, ssa_260
 stib.base0 imm[0.000000,0,0x0], ssa_265, ssa_266, false-deps:ssa_263, ssa_263
 stib.base0 imm[0.000000,0,0x0], ssa_269, ssa_270, false-deps:ssa_267, ssa_267
 stib.base0 imm[0.000000,0,0x0], ssa_273, ssa_274, false-deps:ssa_271, ssa_271
  ...

Fixes tests:
 dEQP-VK.geometry.layered.cube_array.36_36_12.secondary_cmd_buffer_inherit_framebuffer
 dEQP-VK.geometry.layered.3d.64_64_8.secondary_cmd_buffer_inherit_framebuffer
 dEQP-VK.geometry.layered.cube_array.64_64_12.secondary_cmd_buffer_inherit_framebuffer

Signed-off-by: Danylo Piliaiev <dpiliaiev at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9386>

---

 src/freedreno/ci/deqp-freedreno-a630-skips.txt | 8 +++-----
 src/freedreno/ir3/ir3.c                        | 5 +++++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/freedreno/ci/deqp-freedreno-a630-skips.txt b/src/freedreno/ci/deqp-freedreno-a630-skips.txt
index e3e6299e04c..1bc586269f4 100644
--- a/src/freedreno/ci/deqp-freedreno-a630-skips.txt
+++ b/src/freedreno/ci/deqp-freedreno-a630-skips.txt
@@ -12,12 +12,10 @@ dEQP-GLES[0-9]*.functional.flush_finish.*
 # Timeouts, passes otherwise
 KHR-GL33.texture_swizzle.smoke
 
-# Timeout on what looks like an infinite loop in ir3's mark_kill_path()
-dEQP-VK.geometry.layered.cube_array.36_36_12.secondary_cmd_buffer_inherit_framebuffer
-# More timeouts, possibly the same.
-dEQP-VK.geometry.layered.3d.64_64_8.secondary_cmd_buffer_inherit_framebuffer
-dEQP-VK.geometry.layered.cube_array.64_64_12.secondary_cmd_buffer_inherit_framebuffer
+# Timeout, stuck on live_effect()
 dEQP-VK.spirv_assembly.instruction.graphics.spirv_ids_abuse.lots_ids_tesse
+
+# Timeout, passes otherwise
 dEQP-VK.tessellation.invariance.outer_edge_division.quads_fractional_odd_spacing
 
 # Timeout (VK-GL-CTS 1.2.5.0)
diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c
index c75033bb337..0cff9fae04e 100644
--- a/src/freedreno/ir3/ir3.c
+++ b/src/freedreno/ir3/ir3.c
@@ -294,6 +294,11 @@ struct ir3_instruction * ir3_instr_clone(struct ir3_instruction *instr)
 /* Add a false dependency to instruction, to ensure it is scheduled first: */
 void ir3_instr_add_dep(struct ir3_instruction *instr, struct ir3_instruction *dep)
 {
+	for (unsigned i = 0; i < instr->deps_count; i++) {
+		if (instr->deps[i] == dep)
+			return;
+	}
+
 	array_insert(instr, instr->deps, dep);
 }
 



More information about the mesa-commit mailing list