[all-commits] [llvm/llvm-project] abfd1a: [mlir][PDL] Add support for PDL bytecode and expos...
Eric Astor via All-commits
all-commits at lists.llvm.org
Tue Dec 1 15:11:12 PST 2020
Branch: refs/heads/temp-test-main
Home: https://github.com/llvm/llvm-project
Commit: abfd1a8b3bc5ad8516a83c3ae7ba9f16032525ad
https://github.com/llvm/llvm-project/commit/abfd1a8b3bc5ad8516a83c3ae7ba9f16032525ad
Author: River Riddle <riddleriver at gmail.com>
Date: 2020-12-01 (Tue, 01 Dec 2020)
Changed paths:
M mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
M mlir/include/mlir/IR/BlockSupport.h
M mlir/include/mlir/IR/Operation.h
M mlir/include/mlir/IR/OperationSupport.h
M mlir/include/mlir/IR/PatternMatch.h
M mlir/include/mlir/IR/StorageUniquerSupport.h
M mlir/include/mlir/Rewrite/FrozenRewritePatternList.h
M mlir/include/mlir/Rewrite/PatternApplicator.h
M mlir/lib/IR/Block.cpp
M mlir/lib/IR/Operation.cpp
M mlir/lib/IR/PatternMatch.cpp
A mlir/lib/Rewrite/ByteCode.cpp
A mlir/lib/Rewrite/ByteCode.h
M mlir/lib/Rewrite/CMakeLists.txt
M mlir/lib/Rewrite/FrozenRewritePatternList.cpp
M mlir/lib/Rewrite/PatternApplicator.cpp
A mlir/test/Rewrite/pdl-bytecode.mlir
M mlir/test/lib/CMakeLists.txt
A mlir/test/lib/Rewrite/CMakeLists.txt
A mlir/test/lib/Rewrite/TestPDLByteCode.cpp
M mlir/test/lib/Transforms/TestLinalgTransforms.cpp
M mlir/tools/mlir-opt/CMakeLists.txt
M mlir/tools/mlir-opt/mlir-opt.cpp
Log Message:
-----------
[mlir][PDL] Add support for PDL bytecode and expose PDL support to OwningRewritePatternList
PDL patterns are now supported via a new `PDLPatternModule` class. This class contains a ModuleOp with the pdl::PatternOp operations representing the patterns, as well as a collection of registered C++ functions for native constraints/creations/rewrites/etc. that may be invoked via the pdl patterns. Instances of this class are added to an OwningRewritePatternList in the same fashion as C++ RewritePatterns, i.e. via the `insert` method.
The PDL bytecode is an in-memory representation of the PDL interpreter dialect that can be efficiently interpreted/executed. The representation of the bytecode boils down to a code array(for opcodes/memory locations/etc) and a memory buffer(for storing attributes/operations/values/any other data necessary). The bytecode operations are effectively a 1-1 mapping to the PDLInterp dialect operations, with a few exceptions in cases where the in-memory representation of the bytecode can be more efficient than the MLIR representation. For example, a generic `AreEqual` bytecode op can be used to represent AreEqualOp, CheckAttributeOp, and CheckTypeOp.
The execution of the bytecode is split into two phases: matching and rewriting. When matching, all of the matched patterns are collected to avoid the overhead of re-running parts of the matcher. These matched patterns are then considered alongside the native C++ patterns, which rewrite immediately in-place via `RewritePattern::matchAndRewrite`, for the given root operation. When a PDL pattern is matched and has the highest benefit, it is passed back to the bytecode to execute its rewriter.
Differential Revision: https://reviews.llvm.org/D89107
Commit: c64037b784aeae63b1863ee1abd5601c2c6a8102
https://github.com/llvm/llvm-project/commit/c64037b784aeae63b1863ee1abd5601c2c6a8102
Author: Eric Astor <epastor at google.com>
Date: 2020-12-01 (Tue, 01 Dec 2020)
Changed paths:
M llvm/include/llvm/MC/MCParser/MCAsmParser.h
M llvm/lib/MC/MCParser/MasmParser.cpp
A llvm/test/tools/llvm-ml/command_line_defines.asm
M llvm/tools/llvm-ml/Opts.td
M llvm/tools/llvm-ml/llvm-ml.cpp
Log Message:
-----------
[ms] [llvm-ml] Support command-line defines
Enable command-line defines as textmacros
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D90059
Compare: https://github.com/llvm/llvm-project/compare/c7dbaec396ef...c64037b784ae
More information about the All-commits
mailing list