pan/va: Assert no instructions are duplicated
authorAlyssa Rosenzweig <alyssa@collabora.com>
Fri, 23 Jul 2021 21:19:21 +0000 (17:19 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 27 Jul 2021 20:20:32 +0000 (20:20 +0000)
Caught a bug in the published PDF. Whoops!

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12025>

src/panfrost/bifrost/valhall/valhall.py

index b1e4f06..513e71d 100644 (file)
@@ -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))