[all-commits] [llvm/llvm-project] 1bd1ed: [mlir:ODS] Support using attributes in AllTypesMat...

River Riddle via All-commits all-commits at lists.llvm.org
Thu Apr 28 12:58:46 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1bd1edaf4006ff66a88ac59e0931f22105003a26
      https://github.com/llvm/llvm-project/commit/1bd1edaf4006ff66a88ac59e0931f22105003a26
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-04-28 (Thu, 28 Apr 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td
    M mlir/include/mlir/TableGen/CodeGenHelpers.h
    M mlir/include/mlir/TableGen/Constraint.h
    M mlir/lib/TableGen/Constraint.cpp
    M mlir/lib/TableGen/Operator.cpp
    M mlir/python/mlir/dialects/_arith_ops_ext.py
    M mlir/test/Dialect/Arithmetic/invalid.mlir
    M mlir/test/IR/diagnostic-handler.mlir
    M mlir/test/mlir-tblgen/op-result.td
    M mlir/tools/mlir-tblgen/CodeGenHelpers.cpp
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  -----------
  [mlir:ODS] Support using attributes in AllTypesMatch to automatically add InferTypeOpInterface

This allows for using attribute types in result type inference for use with
InferTypeOpInterface. This was a TODO before, but it isn't much
additional work to properly support this. After this commit,
arith::ConstantOp can now have its InferTypeOpInterface implementation automatically
generated.

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


  Commit: 92a836da07596a9e409c3b4231fe727e0924d0e4
      https://github.com/llvm/llvm-project/commit/92a836da07596a9e409c3b4231fe727e0924d0e4
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-04-28 (Thu, 28 Apr 2022)

  Changed paths:
    M mlir/examples/standalone/include/Standalone/StandaloneOps.h
    M mlir/examples/standalone/lib/Standalone/CMakeLists.txt
    M mlir/include/mlir/Dialect/Math/IR/Math.h
    M mlir/include/mlir/Dialect/Quant/QuantOps.h
    M mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h
    M mlir/lib/Dialect/Quant/IR/CMakeLists.txt
    M mlir/lib/Dialect/SparseTensor/IR/CMakeLists.txt
    M mlir/lib/TableGen/Operator.cpp
    M mlir/test/Analysis/test-shape-fn-report.mlir
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/mlir-tblgen/op-decl-and-defs.td
    M mlir/test/mlir-tblgen/op-result.td
    M mlir/unittests/TableGen/OpBuildGen.cpp

  Log Message:
  -----------
  [mlir] Attach InferTypeOpInterface on SameOperandsAndResultType operations when possible

This allows for inferring the result types of operations in certain situations by using the type of
an operand. This commit allowed for automatically supporting type inference for many more
operations with no additional effort, e.g. nearly all Arithmetic operations now support
result type inferrence with no additional changes.

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


  Commit: d4381b3f93a6e53e1b35232b9a0039b1f5e04c6a
      https://github.com/llvm/llvm-project/commit/d4381b3f93a6e53e1b35232b9a0039b1f5e04c6a
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-04-28 (Thu, 28 Apr 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
    M mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-matcher.mlir
    M mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-rewriter.mlir
    M mlir/test/Dialect/PDL/invalid.mlir
    M mlir/test/Dialect/PDL/ops.mlir
    M mlir/test/Integration/Dialect/PDL/CPU/multiroot.mlir
    M mlir/test/mlir-pdll/CodeGen/MLIR/expr.pdll
    M mlir/test/python/dialects/pdl_ops.py

  Log Message:
  -----------
  [mlir:PDL] Fix a syntax ambiguity in pdl.attribute

pdl.attribute currently has a syntax ambiguity that leads to the incorrect parsing
of pdl.attribute operations with locations that don't also have a constant value. For example:

```
pdl.attribute loc("foo")
```

The above IR is treated as being a pdl.attribute with a constant value containing the location,
`loc("foo")`, which is incorrect. This commit changes the syntax to use `= <constant-value>` to
clearly distinguish when the constant value is present, as opposed to just trying to parse an attribute.

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


  Commit: 9613a850b69d2abf621d4c4a9dd9d967c580bd80
      https://github.com/llvm/llvm-project/commit/9613a850b69d2abf621d4c4a9dd9d967c580bd80
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-04-28 (Thu, 28 Apr 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/lib/Dialect/PDL/IR/PDL.cpp
    M mlir/test/Dialect/PDL/invalid.mlir

  Log Message:
  -----------
  [mlir:PDL] Rework errors for pdl.operations with non-inferrable results

We currently emit an error during verification if a pdl.operation with non-inferrable
results is used within a rewrite. This allows for catching some errors during compile
time, but is slightly broken. For one, the verification at the PDL level assumes that
all dialects have been loaded, which is true at run time, but may not be true when
the PDL is generated (such as via PDLL). This commit fixes this by not emitting the
error if the operation isn't registered, i.e. it uses the `mightHave` variant of trait/interface
methods.

Secondly, we currently don't verify when a pdl.operation has no explicit results, but the
operation being created is known to expect at least one. This commit adds a heuristic
error to detect these cases when possible and fail. We can't always capture when the user
made an error, but we can capture the most common case where the user expected an
operation to infer its result types (when it actually isn't possible).

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


  Commit: 32bf1f1d57e7fdc240ee6e703306c57b0fa16c8e
      https://github.com/llvm/llvm-project/commit/32bf1f1d57e7fdc240ee6e703306c57b0fa16c8e
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-04-28 (Thu, 28 Apr 2022)

  Changed paths:
    M mlir/lib/Parser/AsmParserState.cpp
    M mlir/lib/Tools/lsp-server-support/Protocol.h
    M mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
    M mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
    M mlir/test/mlir-lsp-server/diagnostics.test
    M mlir/test/mlir-pdll-lsp-server/definition-split-file.test

  Log Message:
  -----------
  [mlir:LSP] Improve conversion between SourceMgr and LSP locations

SourceMgr generally uses 1-based locations, whereas the LSP is zero based.
This commit corrects this conversion and also enhances the conversion from SMLoc
to SMRange to support string tokens.

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


  Commit: ebb1e900d3b3edcac0e96f23cd15509f1fbe77d9
      https://github.com/llvm/llvm-project/commit/ebb1e900d3b3edcac0e96f23cd15509f1fbe77d9
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-04-28 (Thu, 28 Apr 2022)

  Changed paths:
    M mlir/lib/Tools/PDLL/Parser/Lexer.cpp
    M mlir/lib/Tools/PDLL/Parser/Parser.cpp
    A mlir/test/mlir-pdll/Parser/string-eof.pdll

  Log Message:
  -----------
  [mlir:PDLL] Fix error handling of eof within a string literal

We currently aren't handling this properly, and in the case
of a string block just crash. This commit adds proper error handling
and detection for eof.

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


  Commit: 651d9f70ed75e360b0a166ddca40526c2df43fe3
      https://github.com/llvm/llvm-project/commit/651d9f70ed75e360b0a166ddca40526c2df43fe3
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-04-28 (Thu, 28 Apr 2022)

  Changed paths:
    M mlir/lib/Tools/PDLL/Parser/Parser.cpp
    M mlir/test/lib/Tools/PDLL/TestPDLL.pdll
    M mlir/test/mlir-pdll/Integration/test-pdll.mlir
    M mlir/test/mlir-pdll/Parser/include_td.pdll

  Log Message:
  -----------
  [mlir:PDLL] Fix the import of native constraints from ODS

We weren't properly returning the result of the constraint,
which leads to errors when actually trying to use the generated
C++.

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


Compare: https://github.com/llvm/llvm-project/compare/53f775bbc0b8...651d9f70ed75


More information about the All-commits mailing list