[all-commits] [llvm/llvm-project] fd226c: [mlir][Python] Roll up of python API fixes.

Stella Laurenzo via All-commits all-commits at lists.llvm.org
Sun Jan 24 19:04:28 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd226c9b028d38145b446dddc50db64eb6012d22
      https://github.com/llvm/llvm-project/commit/fd226c9b028d38145b446dddc50db64eb6012d22
  Author: Stella Laurenzo <stellaraccident at gmail.com>
  Date:   2021-01-24 (Sun, 24 Jan 2021)

  Changed paths:
    M mlir/docs/Bindings/Python.md
    R mlir/examples/python/.style.yapf
    R mlir/examples/python/linalg_matmul.py
    M mlir/lib/Bindings/Python/IRModules.cpp
    M mlir/lib/Bindings/Python/IRModules.h
    M mlir/lib/Bindings/Python/mlir/dialects/_builtin.py
    M mlir/lib/Bindings/Python/mlir/dialects/_linalg.py
    A mlir/test/Bindings/Python/dialects/linalg.py
    M mlir/test/Bindings/Python/insertion_point.py
    M mlir/test/Bindings/Python/ods_helpers.py
    M mlir/test/mlir-tblgen/op-python-bindings.td
    M mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp

  Log Message:
  -----------
  [mlir][Python] Roll up of python API fixes.

* As discussed, fixes the ordering or (operands, results) -> (results, operands) in various `create` like methods.
* Fixes a syntax error in an ODS accessor method.
* Removes the linalg example in favor of a test case that exercises the same.
* Fixes FuncOp visibility to properly use None instead of the empty string and defaults it to None.
* Implements what was documented for requiring that trailing __init__ args `loc` and `ip` are keyword only.
* Adds a check to `InsertionPoint.insert` so that if attempting to insert past the terminator, an exception is raised telling you what to do instead. Previously, this would crash downstream (i.e. when trying to print the resultant module).
* Renames `_ods_build_default` -> `build_generic` and documents it.
* Removes `result` from the list of prohibited words and for single-result ops, defaults to naming the result `result`, thereby matching expectations and what is already implemented on the base class.
* This was intended to be a relatively small set of changes to be inlined with the broader support for ODS generating the most specific builder, but it spidered out once actually testing various combinations, so rolling up separately.

Differential Revision: https://reviews.llvm.org/D95320




More information about the All-commits mailing list