[Mlir-commits] [mlir] [mlir][spirv] Ignore extra comma for category_args in gen_spirv_dialect.py (PR #111776)

Caio Oliveira llvmlistbot at llvm.org
Wed Oct 9 17:59:17 PDT 2024


https://github.com/cmarcelo created https://github.com/llvm/llvm-project/pull/111776

In the code being parsed, the comma separates following traits from the category args.  If there's no category args, it is still present.

>From 33898e728866d543a2a1d6304de533f221f67e49 Mon Sep 17 00:00:00 2001
From: Caio Oliveira <caio.oliveira at intel.com>
Date: Wed, 9 Oct 2024 16:47:31 -0700
Subject: [PATCH] [mlir][spirv] Ignore extra comma for category_args in
 gen_spirv_dialect.py

In the code being parsed, the comma separates following traits from the
category args.  If there's no category args, it is still present.
---
 mlir/utils/spirv/gen_spirv_dialect.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mlir/utils/spirv/gen_spirv_dialect.py b/mlir/utils/spirv/gen_spirv_dialect.py
index 78c1022428d8a1..1d185876decd50 100755
--- a/mlir/utils/spirv/gen_spirv_dialect.py
+++ b/mlir/utils/spirv/gen_spirv_dialect.py
@@ -988,6 +988,7 @@ def extract_td_op_info(op_def):
     op_tmpl_params, _ = get_string_between_nested(op_def, "<", ">")
     opstringname, rest = get_string_between(op_tmpl_params, '"', '"')
     category_args = rest.split("[", 1)[0]
+    category_args = category_args.rsplit(",", 1)[0]
 
     # Get traits
     traits, _ = get_string_between_nested(rest, "[", "]")



More information about the Mlir-commits mailing list