2020-03-21 05:18:47 +08:00
|
|
|
add_subdirectory(Affine)
|
2020-12-11 20:53:49 +08:00
|
|
|
add_subdirectory(ArmNeon)
|
2020-12-15 05:30:53 +08:00
|
|
|
add_subdirectory(ArmSVE)
|
2020-09-29 13:47:00 +08:00
|
|
|
add_subdirectory(Async)
|
2020-03-21 02:05:49 +08:00
|
|
|
add_subdirectory(AVX512)
|
2021-01-16 02:53:15 +08:00
|
|
|
add_subdirectory(Complex)
|
2021-03-11 21:33:44 +08:00
|
|
|
add_subdirectory(DLTI)
|
2019-07-25 15:40:48 +08:00
|
|
|
add_subdirectory(GPU)
|
2019-08-20 08:11:12 +08:00
|
|
|
add_subdirectory(Linalg)
|
2019-08-20 02:00:47 +08:00
|
|
|
add_subdirectory(LLVMIR)
|
2021-02-12 17:34:42 +08:00
|
|
|
add_subdirectory(Math)
|
2020-08-12 23:48:24 +08:00
|
|
|
add_subdirectory(OpenACC)
|
[MLIR] Add OpenMP dialect with barrier operation
Summary:
Barrier is a simple operation that takes no arguments and returns
nothing, but implies a side effect (synchronization of all threads)
Reviewers: jdoerfert
Subscribers: mgorny, guansong, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72400
2020-01-29 19:31:25 +08:00
|
|
|
add_subdirectory(OpenMP)
|
[mlir] Add a new "Pattern Descriptor Language" (PDL) dialect.
PDL presents a high level abstraction for the rewrite pattern infrastructure available in MLIR. This abstraction allows for representing patterns transforming MLIR, as MLIR. This allows for applying all of the benefits that the general MLIR infrastructure provides, to the infrastructure itself. This means that pattern matching can be more easily verified for correctness, targeted by frontends, and optimized.
PDL abstracts over various different aspects of patterns and core MLIR data structures. Patterns are specified via a `pdl.pattern` operation. These operations contain a region body for the "matcher" code, and terminate with a `pdl.rewrite` that either dispatches to an external rewriter or contains a region for the rewrite specified via `pdl`. The types of values in `pdl` are handle types to MLIR C++ types, with `!pdl.attribute`, `!pdl.operation`, and `!pdl.type` directly mapping to `mlir::Attribute`, `mlir::Operation*`, and `mlir::Value` respectively.
An example pattern is shown below:
```mlir
// pdl.pattern contains metadata similarly to a `RewritePattern`.
pdl.pattern : benefit(1) {
// External input operand values are specified via `pdl.input` operations.
// Result types are constrainted via `pdl.type` operations.
%resultType = pdl.type
%inputOperand = pdl.input
%root, %results = pdl.operation "foo.op"(%inputOperand) -> %resultType
pdl.rewrite(%root) {
pdl.replace %root with (%inputOperand)
}
}
```
This is a culmination of the work originally discussed here: https://groups.google.com/a/tensorflow.org/g/mlir/c/j_bn74ByxlQ
Differential Revision: https://reviews.llvm.org/D84578
2020-08-20 03:57:45 +08:00
|
|
|
add_subdirectory(PDL)
|
[mlir][PDL] Add a PDL Interpreter Dialect
The PDL Interpreter dialect provides a lower level abstraction compared to the PDL dialect, and is targeted towards low level optimization and interpreter code generation. The dialect operations encapsulates low-level pattern match and rewrite "primitives", such as navigating the IR (Operation::getOperand), creating new operations (OpBuilder::create), etc. Many of the operations within this dialect also fuse branching control flow with some form of a predicate comparison operation. This type of fusion reduces the amount of work that an interpreter must do when executing.
An example of this representation is shown below:
```mlir
// The following high level PDL pattern:
pdl.pattern : benefit(1) {
%resultType = pdl.type
%inputOperand = pdl.input
%root, %results = pdl.operation "foo.op"(%inputOperand) -> %resultType
pdl.rewrite %root {
pdl.replace %root with (%inputOperand)
}
}
// May be represented in the interpreter dialect as follows:
module {
func @matcher(%arg0: !pdl.operation) {
pdl_interp.check_operation_name of %arg0 is "foo.op" -> ^bb2, ^bb1
^bb1:
pdl_interp.return
^bb2:
pdl_interp.check_operand_count of %arg0 is 1 -> ^bb3, ^bb1
^bb3:
pdl_interp.check_result_count of %arg0 is 1 -> ^bb4, ^bb1
^bb4:
%0 = pdl_interp.get_operand 0 of %arg0
pdl_interp.is_not_null %0 : !pdl.value -> ^bb5, ^bb1
^bb5:
%1 = pdl_interp.get_result 0 of %arg0
pdl_interp.is_not_null %1 : !pdl.value -> ^bb6, ^bb1
^bb6:
pdl_interp.record_match @rewriters::@rewriter(%0, %arg0 : !pdl.value, !pdl.operation) : benefit(1), loc([%arg0]), root("foo.op") -> ^bb1
}
module @rewriters {
func @rewriter(%arg0: !pdl.value, %arg1: !pdl.operation) {
pdl_interp.replace %arg1 with(%arg0)
pdl_interp.return
}
}
}
```
Differential Revision: https://reviews.llvm.org/D84579
2020-08-26 20:12:07 +08:00
|
|
|
add_subdirectory(PDLInterp)
|
2020-03-18 05:56:52 +08:00
|
|
|
add_subdirectory(Quant)
|
2020-05-11 21:00:48 +08:00
|
|
|
add_subdirectory(SCF)
|
2019-08-20 02:00:47 +08:00
|
|
|
add_subdirectory(SDBM)
|
2020-03-18 04:34:52 +08:00
|
|
|
add_subdirectory(Shape)
|
2019-07-16 20:06:57 +08:00
|
|
|
add_subdirectory(SPIRV)
|
2019-08-20 02:00:47 +08:00
|
|
|
add_subdirectory(StandardOps)
|
2020-12-12 06:20:03 +08:00
|
|
|
add_subdirectory(Tensor)
|
2020-11-08 00:35:27 +08:00
|
|
|
add_subdirectory(Tosa)
|
2021-02-19 09:12:12 +08:00
|
|
|
add_subdirectory(Utils)
|
2020-03-18 06:24:27 +08:00
|
|
|
add_subdirectory(Vector)
|
2019-05-15 02:03:55 +08:00
|
|
|
|
2020-02-12 17:03:40 +08:00
|
|
|
set(LLVM_OPTIONAL_SOURCES
|
|
|
|
Traits.cpp
|
|
|
|
)
|
|
|
|
|
2020-02-09 11:27:54 +08:00
|
|
|
add_mlir_library(MLIRDialect
|
2019-03-30 13:10:12 +08:00
|
|
|
Traits.cpp
|
|
|
|
|
|
|
|
ADDITIONAL_HEADER_DIRS
|
|
|
|
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect
|
2020-05-05 03:41:43 +08:00
|
|
|
|
|
|
|
LINK_LIBS PUBLIC
|
2020-03-06 03:49:42 +08:00
|
|
|
MLIRIR
|
|
|
|
)
|