History log of /llvm-project/mlir/tools/mlir-tblgen/RewriterGen.cpp (Results 51 – 75 of 200)
Revision Date Author Comments
# b4001ae8 20-Jul-2021 Chia-hung Duan <chiahungduan@google.com>

[mlir-tblgen] Fix failed matching when binds same operand of an op in different depth

For example, we will generate incorrect code for the pattern,

def : Pat<((FooOp (FooOp, $a, $b), $b)), (...)>;

[mlir-tblgen] Fix failed matching when binds same operand of an op in different depth

For example, we will generate incorrect code for the pattern,

def : Pat<((FooOp (FooOp, $a, $b), $b)), (...)>;

We didn't allow $b to be bond twice with same operand of same op.

Reviewed By: jpienaar

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

show more ...


# 9bdf1ab7 19-Jul-2021 Chia-hung Duan <chiahungduan@google.com>

[mlir-tblgen] Slightly improve the diagnostic message in pattern match

Reviewed By: jpienaar

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


# 34b5482b 16-Apr-2021 Chia-hung Duan <chiahungduan@google.com>

Support NativeCodeCall binding in rewrite pattern.

We are able to bind the result from native function while rewriting
pattern. In matching pattern, if we want to get some values back, we can
do tha

Support NativeCodeCall binding in rewrite pattern.

We are able to bind the result from native function while rewriting
pattern. In matching pattern, if we want to get some values back, we can
do that by passing parameter as return value placeholder. Besides, add
the semantic of '$_self' in NativeCodeCall while matching, it'll be the
operation that defines certain operand.

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

show more ...


# 76f3c2f3 23-Mar-2021 River Riddle <riddleriver@gmail.com>

[mlir][Pattern] Add better support for using interfaces/traits to match root operations in rewrite patterns

To match an interface or trait, users currently have to use the `MatchAny` tag. This tag c

[mlir][Pattern] Add better support for using interfaces/traits to match root operations in rewrite patterns

To match an interface or trait, users currently have to use the `MatchAny` tag. This tag can be quite problematic for compile time for things like the canonicalizer, as the `MatchAny` patterns may get applied to *every* operation. This revision adds better support by bucketing interface/trait patterns based on which registered operations have them registered. This means that moving forward we will only attempt to match these patterns to operations that have this interface registered. Two simplify defining patterns that match traits and interfaces, two new utility classes have been added: OpTraitRewritePattern and OpInterfaceRewritePattern.

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

show more ...


# dc4e913b 22-Mar-2021 Chris Lattner <clattner@nondot.org>

[PatternMatch] Big mechanical rename OwningRewritePatternList -> RewritePatternSet and insert -> add. NFC

This doesn't change APIs, this just cleans up the many in-tree uses of these
names to use t

[PatternMatch] Big mechanical rename OwningRewritePatternList -> RewritePatternSet and insert -> add. NFC

This doesn't change APIs, this just cleans up the many in-tree uses of these
names to use the new preferred names. We'll keep the old names around for a
couple weeks to help transitions.

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

show more ...


# 1d909c9a 21-Mar-2021 Chris Lattner <clattner@nondot.org>

Remove the extraneous MLIRContext argument from populateWithGenerated. NFC.


# 02834e1b 03-Mar-2021 Vladislav Vinogradov <vlad.vinogradov@intel.com>

[mlir][ODS] Get rid of limitations in rewriters generator

Do not limit the number of arguments in rewriter pattern.

Introduce separate `FmtStrVecObject` class to handle
format of variadic `std::str

[mlir][ODS] Get rid of limitations in rewriters generator

Do not limit the number of arguments in rewriter pattern.

Introduce separate `FmtStrVecObject` class to handle
format of variadic `std::string` array.

Reviewed By: mehdi_amini

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

show more ...


# e6260ad0 27-Feb-2021 River Riddle <riddleriver@gmail.com>

[mlir] Simplify various pieces of code now that Identifier has access to the Context/Dialect

This also exposed a bug in Dialect loading where it was not correctly identifying identifiers that had th

[mlir] Simplify various pieces of code now that Identifier has access to the Context/Dialect

This also exposed a bug in Dialect loading where it was not correctly identifying identifiers that had the dialect namespace as a prefix.

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

show more ...


# f1bdf9fa 02-Feb-2021 Vladislav Vinogradov <vlad.vinogradov@intel.com>

[mlir][NFC] Use explicit `mlir` namespace in generated code

This makes the generated code independent from actual namespace of its users.

Reviewed By: rriddle

Differential Revision: https://review

[mlir][NFC] Use explicit `mlir` namespace in generated code

This makes the generated code independent from actual namespace of its users.

Reviewed By: rriddle

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

show more ...


# f02e61a8 08-Jan-2021 Mehdi Amini <joker.eph@gmail.com>

Fix MLIR DRR matching when attributes are interleaved with operands

The ODSOperand indexing should ignore the attributes.

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


# e0a93e4b 06-Jan-2021 River Riddle <riddleriver@gmail.com>

[mlir][ODS] Rename several uses of 'description' to 'summary'

Right now constraint/predicate traits/etc. use their "description" field as a one line human readable string. This breaks the current co

[mlir][ODS] Rename several uses of 'description' to 'summary'

Right now constraint/predicate traits/etc. use their "description" field as a one line human readable string. This breaks the current convention, by which a "description" may be multi-line. This revision renames the "description" field in these cases to "summary" which matches what the string is actually used as. This also unbreaks the use of TypeDefs(and eventually AttrDefs) in conjunction with existing type constraint facilities like `Optional`.

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

show more ...


# 58ce4776 30-Dec-2020 Mehdi Amini <joker.eph@gmail.com>

Fix DRR pattern when attributes and operands are interleaved and a dag subtree appears in the rewrite

This fixes an incorrect fatal error in TableGen. This code probably comes
from before attributes

Fix DRR pattern when attributes and operands are interleaved and a dag subtree appears in the rewrite

This fixes an incorrect fatal error in TableGen. This code probably comes
from before attributes were allowed to interleave with operands in ODS.

Reviewed By: jpienaar

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

show more ...


# ff2e2285 01-Dec-2020 Ray (I-Jui) Sung <ijsung@google.com>

Don't count attributes when addressing operands.

Fixes out-of-bound access in generated nested DAG rewriter matching code.

Reviewed By: tpopp

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


# c0963779 16-Oct-2020 Rob Suderman <rob.suderman@gmail.com>

Fixed a failure when const matcher fails, added a test to catch

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


# 2bf423b0 09-Oct-2020 Rob Suderman <rob.suderman@gmail.com>

[mlir] RewriterGen NativeCodeCall matcher with ConstantOp matcher

Added an underlying matcher for generic constant ops. This
included a rewriter of RewriterGen to make variable use more
clear.

Diff

[mlir] RewriterGen NativeCodeCall matcher with ConstantOp matcher

Added an underlying matcher for generic constant ops. This
included a rewriter of RewriterGen to make variable use more
clear.

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

show more ...


# 008c0ea6 14-Oct-2020 rdzhabarov <rdzhabarov@google.com>

[DDR] Introduce implicit equality check for the source pattern operands with the same name.

This CL allows user to specify the same name for the operands in the source pattern which implicitly enfor

[DDR] Introduce implicit equality check for the source pattern operands with the same name.

This CL allows user to specify the same name for the operands in the source pattern which implicitly enforces equality on operands with the same name.
E.g., Pat<(OpA $a, $b, $a) ... > would create a matching rule for checking equality for the first and the last operands. Equality of the operands is enforced at any depth, e.g., OpA ($a, $b, OpB($a, $c, OpC ($a))).

Example usage: Pat<(Reshape $arg0, (Shape $arg0)), (replaceWithValue $arg0)>

Note, this feature only covers operands but not attributes.
Current use cases are based on the operand equality and explicitly add the constraint into the pattern. Attribute equality will be worked out on the different CL.

Reviewed By: jpienaar

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

show more ...


# 0b793c4b 14-Oct-2020 Mehdi Amini <joker.eph@gmail.com>

Revert "[DDR] Introduce implicit equality check for the source pattern operands with the same name."

This reverts commit 7271c1bcb96051bcd227d3fa6071a620fe238850.

This broke the gcc-5 build:

/usr/

Revert "[DDR] Introduce implicit equality check for the source pattern operands with the same name."

This reverts commit 7271c1bcb96051bcd227d3fa6071a620fe238850.

This broke the gcc-5 build:

/usr/include/c++/5/ext/new_allocator.h:120:4: error: no matching function for call to 'std::pair<const std::__cxx11::basic_string<char>, mlir::tblgen::SymbolInfoMap::SymbolInfo>::pair(llvm::StringRef&, mlir::tblgen::SymbolInfoMap::SymbolInfo)'
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
^
In file included from /usr/include/c++/5/utility:70:0,
from llvm/include/llvm/Support/type_traits.h:18,
from llvm/include/llvm/Support/Casting.h:18,
from mlir/include/mlir/Support/LLVM.h:24,
from mlir/include/mlir/TableGen/Pattern.h:17,
from mlir/lib/TableGen/Pattern.cpp:14:
/usr/include/c++/5/bits/stl_pair.h:206:9: note: candidate: template<class ... _Args1, long unsigned int ..._Indexes1, class ... _Args2, long unsigned int ..._Indexes2> std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&, std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>, std::_Index_tuple<_Indexes2 ...>)
pair(tuple<_Args1...>&, tuple<_Args2...>&,
^

show more ...


# 7271c1bc 13-Oct-2020 rdzhabarov <rdzhabarov@google.com>

[DDR] Introduce implicit equality check for the source pattern operands with the same name.

This CL allows user to specify the same name for the operands in the source pattern which implicitly enfor

[DDR] Introduce implicit equality check for the source pattern operands with the same name.

This CL allows user to specify the same name for the operands in the source pattern which implicitly enforces equality on operands with the same name.
E.g., Pat<(OpA $a, $b, $a) ... > would create a matching rule for checking equality for the first and the last operands. Equality of the operands is enforced at any depth, e.g., OpA ($a, $b, OpB($a, $c, OpC ($a))).

Example usage: Pat<(Reshape $arg0, (Shape $arg0)), (replaceWithValue $arg0)>

Note, this feature only covers operands but not attributes.
Current use cases are based on the operand equality and explicitly add the constraint into the pattern. Attribute equality will be worked out on the different CL.

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

show more ...


# 422aaf31 12-Oct-2020 Nicolas Vasilache <nicolas.vasilache@gmail.com>

[mlir][Linalg] Add named Linalg ops on tensor to buffer support.

This revision introduces support for buffer allocation for any named linalg op.
To avoid template instantiating many ops, a new Conve

[mlir][Linalg] Add named Linalg ops on tensor to buffer support.

This revision introduces support for buffer allocation for any named linalg op.
To avoid template instantiating many ops, a new ConversionPattern is created to capture the LinalgOp interface.

Some APIs are updated to remain consistent with MLIR style:
`OwningRewritePatternList * -> OwningRewritePatternList &`
`BufferAssignmentTypeConverter * -> BufferAssignmentTypeConverter &`

Differential revision: https://reviews.llvm.org/D89226

show more ...


# 60cf8453 12-Oct-2020 Nicolas Vasilache <nicolas.vasilache@gmail.com>

Revert "Revert "Give attributes C++ namespaces.""

This reverts commit df295fac6cd14977672b2874700572e0f77b77da.

Reactivates a spuriously rolled back change.


# df295fac 09-Oct-2020 Nicolas Vasilache <nicolas.vasilache@gmail.com>

Revert "Give attributes C++ namespaces."

This reverts commit 0a34492f36d77f043d371cc91f359b2d65e86475.

This change turned out to be very intrusive wrt some internal projects.
Reverting until this c

Revert "Give attributes C++ namespaces."

This reverts commit 0a34492f36d77f043d371cc91f359b2d65e86475.

This change turned out to be very intrusive wrt some internal projects.
Reverting until this can be sorted out.

show more ...


# 0a34492f 09-Oct-2020 Federico Lebrón <flebron@google.com>

Give attributes C++ namespaces.

Reviewed By: mehdi_amini, jpienaar

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


# 9b851527 03-Oct-2020 Jacques Pienaar <jpienaar@google.com>

Add indented raw_ostream class

Class simplifies keeping track of the indentation while emitting. For every new line the current indentation is simply prefixed (if not at start of line, then it just

Add indented raw_ostream class

Class simplifies keeping track of the indentation while emitting. For every new line the current indentation is simply prefixed (if not at start of line, then it just emits as normal). Add a simple Region helper that makes it easy to have the C++ scope match the emitted scope.

Use this in op doc generator and rewrite generator.

This reverts revert commit be185b6a7355fdfeb1c31df2e1272366fe58b01f addresses shared lib failure by fixing up cmake files.

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

show more ...


# be185b6a 03-Oct-2020 Jacques Pienaar <jpienaar@google.com>

Revert "Add indented raw_ostream class"

This reverts commit 78530ce65375fa02bc96019e5cc9d73db8adaca4.

Fails on shared_lib build.


# 78530ce6 03-Oct-2020 Jacques Pienaar <jpienaar@google.com>

Add indented raw_ostream class

Class simplifies keeping track of the indentation while emitting. For every new line the current indentation is simply prefixed (if not at start of line, then it just

Add indented raw_ostream class

Class simplifies keeping track of the indentation while emitting. For every new line the current indentation is simply prefixed (if not at start of line, then it just emits as normal). Add a simple Region helper that makes it easy to have the C++ scope match the emitted scope.

Use this in op doc generator and rewrite generator.

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

show more ...


12345678