#
91a6ad5a |
| 15-Mar-2021 |
Chris Lattner <clattner@nondot.org> |
[m_Constant] Check #operands/results before hasTrait()
We know that all ConstantLike operations have one result and no operands, so check this first before doing the trait check. This change speeds
[m_Constant] Check #operands/results before hasTrait()
We know that all ConstantLike operations have one result and no operands, so check this first before doing the trait check. This change speeds up Canonicalize on a CIRCT testcase by ~5%.
Differential Revision: https://reviews.llvm.org/D98615
show more ...
|
#
b5d9a3c9 |
| 14-Mar-2021 |
Chris Lattner <clattner@nondot.org> |
[Canonicalizer] Process regions top-down instead of bottom up & reuse existing constants.
Two changes: 1) Change the canonicalizer to walk the function in top-down order instead of bottom-up or
[Canonicalizer] Process regions top-down instead of bottom up & reuse existing constants.
Two changes: 1) Change the canonicalizer to walk the function in top-down order instead of bottom-up order. This composes well with the "top down" nature of constant folding and simplification, reducing iterations and re-evaluation of ops in simple cases. 2) Explicitly enter existing constants into the OperationFolder table before canonicalizing. Previously we would "constant fold" them and rematerialize them, wastefully recreating a bunch fo constants, which lead to pointless memory traffic.
Both changes together provide a 33% speedup for canonicalize on some mid-size CIRCT examples.
One artifact of this change is that the constants generated in normal pattern application get inserted at the top of the function as the patterns are applied. Because of this, we get "inverted" constants more often, which is an aethetic change to the IR but does permute some testcases.
Differential Revision: https://reviews.llvm.org/D98609
show more ...
|
Revision tags: llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2 |
|
#
fe7c0d90 |
| 09-Feb-2021 |
River Riddle <riddleriver@gmail.com> |
[mlir][IR] Remove the concept of `OperationProperties`
These properties were useful for a few things before traits had a better integration story, but don't really carry their weight well these days
[mlir][IR] Remove the concept of `OperationProperties`
These properties were useful for a few things before traits had a better integration story, but don't really carry their weight well these days. Most of these properties are already checked via traits in most of the code. It is better to align the system around traits, and improve the performance/cost of traits in general.
Differential Revision: https://reviews.llvm.org/D96088
show more ...
|
#
a1d5bdf8 |
| 04-Feb-2021 |
Mehdi Amini <joker.eph@gmail.com> |
Make the folder more robust against op fold() methods that generate a type mismatch
We could extend this with an interface to allow dialect to perform a type conversion, but that would make the fold
Make the folder more robust against op fold() methods that generate a type mismatch
We could extend this with an interface to allow dialect to perform a type conversion, but that would make the folder creating operation which isn't the case at the moment, and isn't necessarily always desirable.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D95991
show more ...
|
Revision tags: llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1 |
|
#
f88fab50 |
| 07-Jan-2021 |
Kazuaki Ishizaki <ishizaki@jp.ibm.com> |
[mlir] NFC: fix trivial typos
fix typo under include and lib directories
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D94220
|
Revision tags: llvmorg-11.0.1, llvmorg-11.0.1-rc2 |
|
#
444822d7 |
| 11-Dec-2020 |
Sean Silva <silvasean@google.com> |
Revert "Revert "[mlir] Start splitting the `tensor` dialect out of `std`.""
This reverts commit 0d48d265db6633e4e575f81f9d3a52139b1dc5ca.
This reapplies the following commit, with a fix for CAPI/ir
Revert "Revert "[mlir] Start splitting the `tensor` dialect out of `std`.""
This reverts commit 0d48d265db6633e4e575f81f9d3a52139b1dc5ca.
This reapplies the following commit, with a fix for CAPI/ir.c:
[mlir] Start splitting the `tensor` dialect out of `std`.
This starts by moving `std.extract_element` to `tensor.extract` (this mirrors the naming of `vector.extract`).
Curiously, `std.extract_element` supposedly works on vectors as well, and this patch removes that functionality. I would tend to do that in separate patch, but I couldn't find any downstream users relying on this, and the fact that we have `vector.extract` made it seem safe enough to lump in here.
This also sets up the `tensor` dialect as a dependency of the `std` dialect, as some ops that currently live in `std` depend on `tensor.extract` via their canonicalization patterns.
Part of RFC: https://llvm.discourse.group/t/rfc-split-the-tensor-dialect-from-std/2347/2
Differential Revision: https://reviews.llvm.org/D92991
show more ...
|
#
0d48d265 |
| 11-Dec-2020 |
Sean Silva <silvasean@google.com> |
Revert "[mlir] Start splitting the `tensor` dialect out of `std`."
This reverts commit cab8dda90f48e15ee94b0d55ceac5b6a812e4743.
I mistakenly thought that CAPI/ir.c failure was unrelated to this ch
Revert "[mlir] Start splitting the `tensor` dialect out of `std`."
This reverts commit cab8dda90f48e15ee94b0d55ceac5b6a812e4743.
I mistakenly thought that CAPI/ir.c failure was unrelated to this change. Need to debug it.
show more ...
|
#
cab8dda9 |
| 10-Dec-2020 |
Sean Silva <silvasean@google.com> |
[mlir] Start splitting the `tensor` dialect out of `std`.
This starts by moving `std.extract_element` to `tensor.extract` (this mirrors the naming of `vector.extract`).
Curiously, `std.extract_elem
[mlir] Start splitting the `tensor` dialect out of `std`.
This starts by moving `std.extract_element` to `tensor.extract` (this mirrors the naming of `vector.extract`).
Curiously, `std.extract_element` supposedly works on vectors as well, and this patch removes that functionality. I would tend to do that in separate patch, but I couldn't find any downstream users relying on this, and the fact that we have `vector.extract` made it seem safe enough to lump in here.
This also sets up the `tensor` dialect as a dependency of the `std` dialect, as some ops that currently live in `std` depend on `tensor.extract` via their canonicalization patterns.
Part of RFC: https://llvm.discourse.group/t/rfc-split-the-tensor-dialect-from-std/2347/2
Differential Revision: https://reviews.llvm.org/D92991
show more ...
|
#
186c1549 |
| 10-Dec-2020 |
River Riddle <riddleriver@gmail.com> |
[mlir] Remove the dependency on StandardOps from FoldUtils
OperationFolder currently uses ConstantOp as a backup when trying to materialize a constant after an operation is folded. This dependency i
[mlir] Remove the dependency on StandardOps from FoldUtils
OperationFolder currently uses ConstantOp as a backup when trying to materialize a constant after an operation is folded. This dependency isn't really useful or necessary given that dialects can/should provide a `materializeConstant` implementation.
Fixes PR#44866
Differential Revision: https://reviews.llvm.org/D92980
show more ...
|
Revision tags: llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2 |
|
#
b28e3db8 |
| 12-Aug-2020 |
Mehdi Amini <joker.eph@gmail.com> |
Merge OpFolderDialectInterface with DialectFoldInterface (NFC)
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D85823
|
Revision tags: llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1 |
|
#
152d29cc |
| 21-Apr-2020 |
River Riddle <riddleriver@gmail.com> |
[mlir][Transforms] Add pass to perform sparse conditional constant propagation
This revision adds the initial pass for performing SCCP generically in MLIR. SCCP is an algorithm for propagating const
[mlir][Transforms] Add pass to perform sparse conditional constant propagation
This revision adds the initial pass for performing SCCP generically in MLIR. SCCP is an algorithm for propagating constants across control flow, and optimistically assumes all values to be constant unless proven otherwise. It currently supports branching control, with support for regions and inter-procedural propagation being added in followups.
Differential Revision: https://reviews.llvm.org/D78397
show more ...
|
#
cbcb12fd |
| 05-Apr-2020 |
Uday Bondhugula <uday@polymagelabs.com> |
[MLIR] Handle in-place folding properly in greedy pattern rewrite driver
OperatioFolder::tryToFold performs both true folding and in a few instances in-place updates through op rewrites. In the latt
[MLIR] Handle in-place folding properly in greedy pattern rewrite driver
OperatioFolder::tryToFold performs both true folding and in a few instances in-place updates through op rewrites. In the latter case, we should still be applying the supplied pattern rewrites in the same iteration; however this wasn't the case since tryToFold returned success() for both true folding and in-place updates, and the patterns for the in-place updated ops were being applied only in the next iteration of the driver's outer loop. This fix would make it converge faster.
Differential Revision: https://reviews.llvm.org/D77485
show more ...
|
Revision tags: llvmorg-10.0.0, llvmorg-10.0.0-rc6 |
|
#
04f2b717 |
| 19-Mar-2020 |
MaheshRavishankar <ravishankarm@google.com> |
[mlir] Fix unsafe create operation in GreedyPatternRewriter
When trying to fold an operation during operation creation check that the operation folding succeeds before inserting the op.
Differentia
[mlir] Fix unsafe create operation in GreedyPatternRewriter
When trying to fold an operation during operation creation check that the operation folding succeeds before inserting the op.
Differential Revision: https://reviews.llvm.org/D76415
show more ...
|
Revision tags: llvmorg-10.0.0-rc5 |
|
#
0ddd0439 |
| 17-Mar-2020 |
Uday Bondhugula <uday@polymagelabs.com> |
[MLIR] Fix op folding to not run pre-replace when not constant folding
OperationFolder::tryToFold was running the pre-replacement action even when there was no constant folding, i.e., when the oper
[MLIR] Fix op folding to not run pre-replace when not constant folding
OperationFolder::tryToFold was running the pre-replacement action even when there was no constant folding, i.e., when the operation was just being updated in place but was not going to be replaced. This led to nested ops being unnecessarily removed from the worklist and only being processed in the next outer iteration of the greedy pattern rewriter, which is also why this didn't affect the final output IR but only the convergence rate. It also led to an op's results' users to be unnecessarily added to the worklist.
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D76268
show more ...
|
Revision tags: llvmorg-10.0.0-rc4 |
|
#
0ddba0bd |
| 12-Mar-2020 |
River Riddle <riddleriver@gmail.com> |
[mlir][SideEffects] Replace HasNoSideEffect with the memory effect interfaces.
HasNoSideEffect can now be implemented using the MemoryEffectInterface, removing the need to check multiple things for
[mlir][SideEffects] Replace HasNoSideEffect with the memory effect interfaces.
HasNoSideEffect can now be implemented using the MemoryEffectInterface, removing the need to check multiple things for the same information. This also removes an easy foot-gun for users as 'Operation::hasNoSideEffect' would ignore operations that dynamically, or recursively, have no side effects. This also leads to an immediate improvement in some of the existing users, such as DCE, now that they have access to more information.
Differential Revision: https://reviews.llvm.org/D76036
show more ...
|
#
907403f3 |
| 12-Mar-2020 |
River Riddle <riddleriver@gmail.com> |
[mlir] Add a new `ConstantLike` trait to better identify operations that represent a "constant".
The current mechanism for identifying is a bit hacky and extremely adhoc, i.e. we explicit check 1-re
[mlir] Add a new `ConstantLike` trait to better identify operations that represent a "constant".
The current mechanism for identifying is a bit hacky and extremely adhoc, i.e. we explicit check 1-result, 0-operand, no side-effect, and always foldable and then assume that this is a constant. Adding a trait adds structure to this, and makes checking for a constant much more efficient as we can guarantee that all of these things have already been verified.
Differential Revision: https://reviews.llvm.org/D76020
show more ...
|
Revision tags: llvmorg-10.0.0-rc3 |
|
#
69d757c0 |
| 21-Feb-2020 |
Rob Suderman <suderman@google.com> |
Move StandardOps/Ops.h to StandardOps/IR/Ops.h
Summary: NFC - Moved StandardOps/Ops.h to a StandardOps/IR dir to better match surrounding directories. This is to match other dialects, and prepare fo
Move StandardOps/Ops.h to StandardOps/IR/Ops.h
Summary: NFC - Moved StandardOps/Ops.h to a StandardOps/IR dir to better match surrounding directories. This is to match other dialects, and prepare for moving StandardOps related transforms in out for Transforms and into StandardOps/Transforms.
Differential Revision: https://reviews.llvm.org/D74940
show more ...
|
Revision tags: llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3 |
|
#
b80a9ca8 |
| 09-Dec-2019 |
Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> |
[MLIR] Allow non-binary operations to be commutative
NFC for binary operations.
Differential Revision: https://reviews.llvm.org/D73670
|
#
30857107 |
| 26-Jan-2020 |
Mehdi Amini <aminim@google.com> |
Mass update the MLIR license header to mention "Part of the LLVM project"
This is an artifact from merging MLIR into LLVM, the file headers are now aligned with the rest of the project.
|
#
2bdf33cc |
| 11-Jan-2020 |
River Riddle <riverriddle@google.com> |
[mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is properly value-typed.
Summary: These were temporary methods used to simplify the transition.
Reviewed By: antiagainst
Di
[mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is properly value-typed.
Summary: These were temporary methods used to simplify the transition.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D72548
show more ...
|
#
0f0d0ed1 |
| 24-Dec-2019 |
Mehdi Amini <aminim@google.com> |
Import MLIR into the LLVM tree
|
#
e62a6956 |
| 23-Dec-2019 |
River Riddle <riverriddle@google.com> |
NFC: Replace ValuePtr with Value and remove it now that Value is value-typed.
ValuePtr was a temporary typedef during the transition to a value-typed Value.
PiperOrigin-RevId: 286945714
|
#
56222a06 |
| 23-Dec-2019 |
Mehdi Amini <aminim@google.com> |
Adjust License.txt file to use the LLVM license
PiperOrigin-RevId: 286906740
|
#
35807bc4 |
| 23-Dec-2019 |
River Riddle <riverriddle@google.com> |
NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to Value being value-typed.
This is an initial step to refactoring the representation of OpResult as proposed in: https://gro
NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to Value being value-typed.
This is an initial step to refactoring the representation of OpResult as proposed in: https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ
This change will make it much simpler to incrementally transition all of the existing code to use value-typed semantics.
PiperOrigin-RevId: 286844725
show more ...
|
#
4562e389 |
| 18-Dec-2019 |
River Riddle <riverriddle@google.com> |
NFC: Remove unnecessary 'llvm::' prefix from uses of llvm symbols declared in `mlir` namespace.
Aside from being cleaner, this also makes the codebase more consistent.
PiperOrigin-RevId: 286206974
|