[all-commits] [llvm/llvm-project] 7d4cd4: [mlir][python] Handle dashes in op name

JoelWee via All-commits all-commits at lists.llvm.org
Tue Oct 10 06:39:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7d4cd47e242c28c450c1e2a1a9f4bd4b7b5a01ab
      https://github.com/llvm/llvm-project/commit/7d4cd47e242c28c450c1e2a1a9f4bd4b7b5a01ab
  Author: JoelWee <32009741+JoelWee at users.noreply.github.com>
  Date:   2023-10-10 (Tue, 10 Oct 2023)

  Changed paths:
    M mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp

  Log Message:
  -----------
  [mlir][python] Handle dashes in op name

The python generated code for 
```
def StableHLO_CrossReplicaSumOp : StableHLO_Op<"cross-replica-sum",
```

fails because the python code 

`def cross-replica-sum...` is generated, which is not a valid python name.

https://github.com/openxla/stablehlo/blob/main/stablehlo/dialect/StablehloOps.td#L2109




More information about the All-commits mailing list