Mesa (main): pan/va: Assert no instructions are duplicated
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jul 27 20:33:38 UTC 2021
Module: Mesa
Branch: main
Commit: c43327c049612a8a0e91032479d7a6847074d86c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c43327c049612a8a0e91032479d7a6847074d86c
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Fri Jul 23 17:19:21 2021 -0400
pan/va: Assert no instructions are duplicated
Caught a bug in the published PDF. Whoops!
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12025>
---
src/panfrost/bifrost/valhall/valhall.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/panfrost/bifrost/valhall/valhall.py b/src/panfrost/bifrost/valhall/valhall.py
index b1e4f06193f..513e71d73dc 100644
--- a/src/panfrost/bifrost/valhall/valhall.py
+++ b/src/panfrost/bifrost/valhall/valhall.py
@@ -360,3 +360,13 @@ for child in root:
build_instr(child)
instruction_dict = { ins.name: ins for ins in instructions }
+
+# Validate there are no duplicated instructions
+if len(instruction_dict) != len(instructions):
+ import collections
+ counts = collections.Counter([i.name for i in instructions])
+ for c in counts:
+ if counts[c] != 1:
+ print(f'{c} appeared {counts[c]} times.')
+
+assert(len(instruction_dict) == len(instructions))
More information about the mesa-commit
mailing list