Skip to content

Commit 64bcb27

Browse files
authored
[mlir][spirv] Make gen_spirv_dialect.py more precise when finding inst_category (#111777)
Use a word boundary, current code was currently failing when parsing the definition of because it would also match `CooperativeMatrixOp` from a later mention of `SPIRV_KHR_CooperativeMatrixOperandsAttr`.
1 parent 03447ab commit 64bcb27

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/utils/spirv/gen_spirv_dialect.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,8 @@ def extract_td_op_info(op_def):
979979
# Get instruction category
980980
prefix = "SPIRV_"
981981
inst_category = [
982-
o[len(prefix) :] for o in re.findall(prefix + r"\w+Op", op_def.split(":", 1)[1])
982+
o[len(prefix) :]
983+
for o in re.findall(prefix + r"\w+Op\b", op_def.split(":", 1)[1])
983984
]
984985
assert len(inst_category) <= 1, "more than one ops in the same section!"
985986
inst_category = inst_category[0] if len(inst_category) == 1 else "Op"

0 commit comments

Comments
 (0)