[Mlir-commits] [mlir] [mlir][python] Improve sanitization of python names (PR #68801)

Maksim Levental llvmlistbot at llvm.org
Wed Oct 11 09:46:03 PDT 2023


================
@@ -616,6 +616,15 @@ def VariadicRegionOp : TestOp<"variadic_region"> {
 // CHECK: def variadic_region(num_variadic, *, loc=None, ip=None)
 // CHECK:   return _get_op_result_or_op_results(VariadicRegionOp(num_variadic=num_variadic, loc=loc, ip=ip))
 
+// CHECK: @_ods_cext.register_operation(_Dialect)
+// CHECK: class WithSpecialCharactersOp(_ods_ir.OpView):
+// CHECK-LABEL: OPERATION_NAME = "test.123with- special.characters"
+def WithSpecialCharactersOp : TestOp<"123with- special.characters"> {
+}
+
+// CHECK: def _123with__special_characters(*, loc=None, ip=None)
----------------
makslevental wrote:

Definitely agree "no collapsing" and also secondly agree spaces shouldn't be allowed in mnemonics at all (I'm surprised they are...)

https://github.com/llvm/llvm-project/pull/68801


More information about the Mlir-commits mailing list