[all-commits] [llvm/llvm-project] 8c6634: [mlir:PDL] Add support for DialectConversion with ...

River Riddle via All-commits all-commits at lists.llvm.org
Tue Nov 8 01:58:33 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c66344ee9f67f76b3cb6b3345a46345a2d3975a
      https://github.com/llvm/llvm-project/commit/8c66344ee9f67f76b3cb6b3345a46345a2d3975a
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-11-08 (Tue, 08 Nov 2022)

  Changed paths:
    M mlir/include/mlir/Conversion/PDLToPDLInterp/PDLToPDLInterp.h
    M mlir/include/mlir/IR/PatternMatch.h
    M mlir/include/mlir/Transforms/DialectConversion.h
    A mlir/include/mlir/Transforms/DialectConversion.pdll
    M mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
    M mlir/lib/IR/PatternMatch.cpp
    M mlir/lib/Rewrite/ByteCode.cpp
    M mlir/lib/Rewrite/ByteCode.h
    M mlir/lib/Rewrite/FrozenRewritePatternSet.cpp
    M mlir/lib/Rewrite/PatternApplicator.cpp
    M mlir/lib/Tools/PDLL/CodeGen/CPPGen.cpp
    M mlir/lib/Transforms/Utils/DialectConversion.cpp
    A mlir/test/Transforms/test-dialect-conversion-pdll.mlir
    M mlir/test/lib/Transforms/CMakeLists.txt
    A mlir/test/lib/Transforms/TestDialectConversion.cpp
    A mlir/test/lib/Transforms/TestDialectConversion.pdll
    A mlir/test/lib/Transforms/lit.local.cfg
    M mlir/test/mlir-pdll/CodeGen/CPP/general.pdll
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [mlir:PDL] Add support for DialectConversion with pattern configurations

Up until now PDL(L) has not supported dialect conversion because we had no
way of remapping values or integrating with type conversions. This commit
rectifies that by adding a new "pattern configuration" concept to PDL. This
essentially allows for attaching external configurations to patterns, which
can hook into pattern events (for now just the scope of a rewrite, but we
could also pass configs to native rewrites as well). This allows for injecting
the type converter into the conversion pattern rewriter.

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


  Commit: ce57789d8e5dc109dc9bd330232b31a22a80ad3a
      https://github.com/llvm/llvm-project/commit/ce57789d8e5dc109dc9bd330232b31a22a80ad3a
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-11-08 (Tue, 08 Nov 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
    M mlir/include/mlir/Dialect/PDL/IR/PDLTypes.h
    M mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
    M mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
    M mlir/lib/Dialect/PDL/IR/PDL.cpp
    M mlir/lib/Dialect/PDL/IR/PDLTypes.cpp
    M mlir/lib/Dialect/PDLInterp/IR/PDLInterp.cpp
    M mlir/lib/Rewrite/ByteCode.cpp
    M mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-rewriter.mlir
    M mlir/test/Dialect/PDL/invalid.mlir
    M mlir/test/Dialect/PDLInterp/invalid.mlir
    M mlir/test/Rewrite/pdl-bytecode.mlir

  Log Message:
  -----------
  [mlir:PDL] Add support for creating ranges in rewrites

This commit adds support for building a concatenated range from
a given set of elements, either single element or other ranges, within a
rewrite. We could conceptually extend this to support constraining
input ranges, but the logic there is quite a bit more complex so it is
left for later work when a need arises.

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


  Commit: 9e57210ad9f76b93bb8e9fc441be5cf3597b2928
      https://github.com/llvm/llvm-project/commit/9e57210ad9f76b93bb8e9fc441be5cf3597b2928
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-11-08 (Tue, 08 Nov 2022)

  Changed paths:
    M mlir/include/mlir/Tools/PDLL/AST/Nodes.h
    M mlir/lib/Tools/PDLL/AST/NodePrinter.cpp
    M mlir/lib/Tools/PDLL/AST/Nodes.cpp
    M mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp
    M mlir/lib/Tools/PDLL/Parser/Parser.cpp
    M mlir/test/mlir-pdll/CodeGen/MLIR/expr.pdll
    M mlir/test/mlir-pdll/Parser/expr-failure.pdll
    M mlir/test/mlir-pdll/Parser/expr.pdll

  Log Message:
  -----------
  [mlir:PDLL] Add support for building a range from a tuple within a rewrite

This allows for constructing type and value ranges from various sub elements,
which makes it easier to construct operations that take a range as an operand
or result type. Range construction is currently limited to within rewrites, to match
the current constraint on the PDL side.

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


  Commit: ec92a125acc66c67e8d86dcf6e200fe34d204b3d
      https://github.com/llvm/llvm-project/commit/ec92a125acc66c67e8d86dcf6e200fe34d204b3d
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-11-08 (Tue, 08 Nov 2022)

  Changed paths:
    M mlir/lib/Tools/PDLL/Parser/Parser.cpp
    M mlir/test/lib/Transforms/TestDialectConversion.pdll
    M mlir/test/mlir-pdll/Parser/expr.pdll
    M mlir/test/mlir-pdll/Parser/include/ops.td

  Log Message:
  -----------
  [mlir:PDLL] Don't require users to provide operands/results when all are variadic

When all operands or results are variadic, zero values is a perfectly valid behavior
to expect, and we shouldn't force the user to provide values in this case. For example,
when creating a call or a return operation we often don't want/need to provide return
values.

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


  Commit: b6ec1de7cbc4dda73248c6636d0747fd445598a4
      https://github.com/llvm/llvm-project/commit/b6ec1de7cbc4dda73248c6636d0747fd445598a4
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-11-08 (Tue, 08 Nov 2022)

  Changed paths:
    M mlir/include/mlir/Tools/PDLL/AST/Nodes.h
    M mlir/include/mlir/Tools/PDLL/Parser/CodeComplete.h
    M mlir/lib/Tools/PDLL/Parser/CodeComplete.cpp
    M mlir/lib/Tools/PDLL/Parser/Parser.cpp
    M mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
    M mlir/test/mlir-pdll/CodeGen/CPP/general.pdll
    A mlir/test/mlir-pdll/CodeGen/CPP/include/ods.td
    M mlir/test/mlir-pdll/Parser/rewrite-failure.pdll

  Log Message:
  -----------
  [mlir:PDLL] Allow complex constraints on Rewrite arguments/results

The documentation already has examples of this, and it allows for
using nicer C++ types when defining native Rewrites.

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


Compare: https://github.com/llvm/llvm-project/compare/f3a86a23c10d...b6ec1de7cbc4


More information about the All-commits mailing list