From 5620c3efd85f42a1301d63d55195704ee8365e5e Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Tue, 21 Apr 2020 21:54:56 -0700 Subject: [PATCH] spirv: Handle instruction aliases in vtn_gather_types Same solution as done in spirv_info generation. Reviewed-by: Jason Ekstrand Part-of: --- src/compiler/spirv/vtn_gather_types_c.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/compiler/spirv/vtn_gather_types_c.py b/src/compiler/spirv/vtn_gather_types_c.py index 7b42e95cc35..d30a91d2b7a 100644 --- a/src/compiler/spirv/vtn_gather_types_c.py +++ b/src/compiler/spirv/vtn_gather_types_c.py @@ -29,7 +29,13 @@ from sys import stdout from mako.template import Template def find_result_types(spirv): + seen = set() for inst in spirv['instructions']: + # Handle aliases by choosing the first one in the grammar. + if inst['opcode'] in seen: + continue + seen.add(inst['opcode']) + name = inst['opname'] if 'operands' not in inst: -- 2.30.2