[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Dialect Conversion: Move argument materialization logic (PR #98805)

2024-07-14 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/98805 This commit moves the argument materialization logic from `legalizeConvertedArgumentTypes` to `legalizeUnresolvedMaterializations`. Before this change: - Argument materializations were created in

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Simplify handling of dropped arguments (PR #97213)

2024-07-14 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer ready_for_review https://github.com/llvm/llvm-project/pull/97213 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Simplify handling of dropped arguments (PR #97213)

2024-07-13 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/97213 >From b0b781318e5f76f28b9340efbdcc3f91c2c1cf31 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Sat, 13 Jul 2024 17:36:37 +0200 Subject: [PATCH] [mlir][Transforms] Dialect conversion: Simplify

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Fix missing source materialization (PR #97903)

2024-07-13 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/97903 >From 577317640c0f5800650157f5c4c6fbe6220eba38 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Sat, 6 Jul 2024 14:28:41 +0200 Subject: [PATCH] fix test --- mlir/docs/DialectConversion.md

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Simplify handling of dropped arguments (PR #97213)

2024-07-13 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/97213 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Simplify handling of dropped arguments (PR #97213)

2024-07-13 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/97213 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Fix missing source materialization (PR #97903)

2024-07-13 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/97903 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Fix missing source materialization (PR #97903)

2024-07-13 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/97903 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Conversion] `FuncToLLVM`: Simplify bare-pointer handling (PR #96393)

2024-06-22 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/96393 >From 2d838580bf8c17ea7a17d73415b3c64c1775b37d Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Sat, 22 Jun 2024 14:54:21 +0200 Subject: [PATCH] [mlir][Conversion] `FuncToLLVM`: Simplify

[llvm-branch-commits] [mlir] [mlir][Conversion] `FuncToLLVM`: Simplify bare-pointer handling (PR #96393)

2024-06-22 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/96393 Before this commit, there used to be a workaround in the `func.func`/`gpu.func` op lowering when the bare-pointer calling convention is enabled. This workaround "patched up" the argument

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Dialect Conversion: Move argument materialization logic (PR #96329)

2024-06-21 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/96329 This commit moves the argument materialization logic from `legalizeConvertedArgumentTypes` to `legalizeUnresolvedMaterializations`. Before this change: - Argument materializations were created in

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Simplify handling of dropped arguments (PR #96207)

2024-06-20 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/96207 This commit simplifies the handling of dropped arguments and updates some dialect conversion documentation that is outdated. When converting a block signature, a `BlockTypeConversionRewrite` object

[llvm-branch-commits] [mlir] [draft] Dialect Conversion without Rollback (PR #93412)

2024-05-29 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/93412 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [draft] Dialect Conversion without Rollback (PR #93412)

2024-05-29 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/93412 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [draft] Dialect Conversion without Rollback (PR #93412)

2024-05-29 Thread Matthias Springer via llvm-branch-commits
@@ -1053,3 +1055,241 @@ LogicalResult mlir::applyOpPatternsAndFold( }); return converged; } + +//===--===// +// One-Shot Dialect Conversion Infrastructure

[llvm-branch-commits] [mlir] [draft] Dialect Conversion without Rollback (PR #93412)

2024-05-29 Thread Matthias Springer via llvm-branch-commits
@@ -1053,3 +1055,241 @@ LogicalResult mlir::applyOpPatternsAndFold( }); return converged; } + +//===--===// +// One-Shot Dialect Conversion Infrastructure

[llvm-branch-commits] [mlir] [draft] Dialect Conversion without Rollback (PR #93412)

2024-05-29 Thread Matthias Springer via llvm-branch-commits
@@ -1053,3 +1055,241 @@ LogicalResult mlir::applyOpPatternsAndFold( }); return converged; } + +//===--===// +// One-Shot Dialect Conversion Infrastructure

[llvm-branch-commits] [mlir] [draft] Dialect Conversion without Rollback (PR #93412)

2024-05-28 Thread Matthias Springer via llvm-branch-commits
@@ -1053,3 +1055,241 @@ LogicalResult mlir::applyOpPatternsAndFold( }); return converged; } + +//===--===// +// One-Shot Dialect Conversion Infrastructure

[llvm-branch-commits] [mlir] [draft] Dialect Conversion without Rollback (PR #93412)

2024-05-28 Thread Matthias Springer via llvm-branch-commits
@@ -1053,3 +1055,241 @@ LogicalResult mlir::applyOpPatternsAndFold( }); return converged; } + +//===--===// +// One-Shot Dialect Conversion Infrastructure

[llvm-branch-commits] [mlir] [draft] Dialect Conversion without Rollback (PR #93412)

2024-05-28 Thread Matthias Springer via llvm-branch-commits
@@ -321,15 +323,15 @@ class RandomizedWorklist : public Worklist { /// to the worklist in the beginning. class GreedyPatternRewriteDriver : public RewriterBase::Listener { protected: - explicit GreedyPatternRewriteDriver(MLIRContext *ctx, + explicit

[llvm-branch-commits] [mlir] [draft] Dialect Conversion without Rollback (PR #93412)

2024-05-27 Thread Matthias Springer via llvm-branch-commits
matthias-springer wrote: You are right, there is one thing that conversion patterns are no longer allowed to do. From the RFC: ``` One change is needed for existing conversion patterns: they must not modify the IR if they return failure. (Same as ordinary rewrite patterns.) Most patterns

[llvm-branch-commits] [mlir] [draft] Dialect Conversion without Rollback (PR #93412)

2024-05-27 Thread Matthias Springer via llvm-branch-commits
matthias-springer wrote: The final `OneShotConversionPatternRewriter` will support everything that `ConversionPatternRewriter` supports. A few helper functions are still missing in this PR: - `applySignatureConversion` - `convertRegionTypes` - `convertNonEntryRegionTypes` -

[llvm-branch-commits] [mlir] [draft] Dialect Conversion without Rollback (PR #93412)

2024-05-26 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/93412 This commit adds a dialect conversion driver without rollback: `OneShotDialectConversionDriver` The new driver reuses some functionality of the greedy pattern rewrite driver. Just a proof of concept,

[llvm-branch-commits] [mlir] [mlir][Interfaces] `Variable` abstraction for `ValueBoundsOpInterface` (PR #87980)

2024-04-15 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/87980 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Interfaces][WIP] `Variable` abstraction for `ValueBoundsOpInterface` (PR #87980)

2024-04-15 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/87980 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Interfaces][WIP] `Variable` abstraction for `ValueBoundsOpInterface` (PR #87980)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/87980 >From 183ab14683a335e65891e1d585f69231699efceb Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Mon, 8 Apr 2024 11:25:29 + Subject: [PATCH] [mlir][Interfaces][WIP] `ValueBoundsOpInterface`:

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix typo (PR #87976)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/87976 >From d8c3fd63044c9b7dfd33c2023729b9a4b72b4886 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Mon, 8 Apr 2024 09:44:02 + Subject: [PATCH] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix

[llvm-branch-commits] [mlir] [mlir][Interfaces][WIP] `Variable` abstraction for `ValueBoundsOpInterface` (PR #87980)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
@@ -75,6 +75,75 @@ struct MulIOpInterface } }; +struct SelectOpInterface matthias-springer wrote: `SelectOpInterface` was already merged. I have to rebase. https://github.com/llvm/llvm-project/pull/87980 ___

[llvm-branch-commits] [mlir] [mlir][Interfaces][WIP] `Variable` abstraction for `ValueBoundsOpInterface` (PR #87980)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/87980 This commit generalizes and cleans up the `ValueBoundsConstraintSet` API. The API used to provide function overloads for comparing/computing bounds of: - index-typed SSA value - dimension of shaped

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix typo (PR #87976)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/87976 >From 4a019ca348ce2a65684e6417b656a51437e8176d Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Mon, 8 Apr 2024 09:44:02 + Subject: [PATCH] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix typo (PR #87976)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
matthias-springer wrote: It is currently not possible to trigger this bug. New columns are always added to the constraint set as symbols. Only the first added SSA value (for which we compute a bound) is added as a dimension. There is currently no API to compute a bounds for an "AffineMap +

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Fix typo (PR #87976)

2024-04-08 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/87976 This was likely a copy-and-paste typo. >From a09cbb284df8419e6ce819e289aa88bf86b66842 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Mon, 8 Apr 2024 09:44:02 + Subject: [PATCH]

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Add API to compare values (PR #86915)

2024-03-28 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/86915 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Add API to compare values (PR #86915)

2024-03-28 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/86915 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Interfaces] `ValueBoundsOpInterface`: Add API to compare values (PR #86915)

2024-03-28 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/86915 This commit adds a new public API to `ValueBoundsOpInterface` to compare values/dims. Supported comparison operators are: LT, LE, EQ, GE, GT. The new `ValueBoundsOpInterface::compare` API replaces and

[llvm-branch-commits] [mlir] [mlir][Arith] `ValueBoundsOpInterface`: Support `arith.select` (PR #86383)

2024-03-23 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/86383 This commit adds a `ValueBoundsOpInterface` implementation for `arith.select`. The implementation is almost identical to `scf.if` (#85895), but there is one special case: if the condition is a shaped

[llvm-branch-commits] [mlir] [mlir][SCF][NFC] `ValueBoundsConstraintSet`: Simplify `scf.for` implementation (PR #86239)

2024-03-23 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/86239 >From 3c4adb5458f054634d51e1502736bb3dbebad106 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Sat, 23 Mar 2024 06:02:28 + Subject: [PATCH] [mlir][SCF][NFC] `ValueBoundsConstraintSet`:

[llvm-branch-commits] [mlir] [mlir][SCF] `ValueBoundsConstraintSet`: Support `scf.if` (branches) (PR #85895)

2024-03-23 Thread Matthias Springer via llvm-branch-commits
@@ -198,6 +198,28 @@ class ValueBoundsConstraintSet { std::optional dim1 = std::nullopt, std::optional dim2 = std::nullopt); + /// Traverse the IR starting from the given value/dim and add populate + /// constraints as long as

[llvm-branch-commits] [mlir] [mlir][SCF] `ValueBoundsConstraintSet`: Support `scf.if` (branches) (PR #85895)

2024-03-23 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/85895 >From b4bab14a9451e0dd1663fcbce5718d053ba68e5a Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Sat, 23 Mar 2024 05:59:33 + Subject: [PATCH] [mlir][SCF] `ValueBoundsConstraintSet`: Support

[llvm-branch-commits] [mlir] [mlir][Interfaces][NFC] `ValueBoundsConstraintSet`: Pass stop condition in the constructor (PR #86099)

2024-03-22 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/86099 >From ad1b2ac46a744887594e13370762939034797d31 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Sat, 23 Mar 2024 05:57:33 + Subject: [PATCH] [mlir][Interfaces][NFC]

[llvm-branch-commits] [mlir] [mlir][Interfaces][NFC] `ValueBoundsConstraintSet`: Delete dead code (PR #86098)

2024-03-22 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/86098 >From f94427911043e2f4f8db4ea83800ceea19a5ac39 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Sat, 23 Mar 2024 05:55:09 + Subject: [PATCH] [mlir][Interfaces][NFC]

[llvm-branch-commits] [mlir] [mlir][SCF][NFC] `ValueBoundsConstraintSet`: Simplify `scf.for` implementation (PR #86239)

2024-03-21 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/86239 This commit simplifies the implementation of the `ValueBoundsOpInterface` for `scf.for` based on the newly added `ValueBoundsConstraintSet::compare` API and adds additional documentation. Previously,

[llvm-branch-commits] [mlir] [mlir][SCF] `ValueBoundsConstraintSet`: Support `scf.if` (branches) (PR #85895)

2024-03-21 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/85895 >From 8057ddd7f467891b5fec9c1f7426fd06012453fb Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Fri, 22 Mar 2024 02:03:32 + Subject: [PATCH] [mlir][SCF] `ValueBoundsConstraintSet`: Support

[llvm-branch-commits] [mlir] [mlir][Interfaces][NFC] `ValueBoundsConstraintSet`: Pass stop condition in the constructor (PR #86099)

2024-03-21 Thread Matthias Springer via llvm-branch-commits
@@ -316,6 +317,9 @@ class ValueBoundsConstraintSet { /// Builder for constructing affine expressions. Builder builder; + + /// The current stop condition function. + StopConditionFn stopCondition = nullptr; matthias-springer wrote: Actually I ran into

[llvm-branch-commits] [mlir] [mlir][Interfaces][NFC] `ValueBoundsConstraintSet`: Pass stop condition in the constructor (PR #86099)

2024-03-21 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/86099 >From 305001b6211f48e7643c34805e7008126a539b49 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Fri, 22 Mar 2024 02:01:00 + Subject: [PATCH] [mlir][Interfaces][NFC]

[llvm-branch-commits] [mlir] [mlir][SCF] `ValueBoundsConstraintSet`: Support `scf.if` (branches) (PR #85895)

2024-03-21 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/85895 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Interfaces][NFC] `ValueBoundsConstraintSet`: Pass stop condition in the constructor (PR #86099)

2024-03-21 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/86099 This commit changes the API of `ValueBoundsConstraintSet`: the stop condition is now passed to the constructor instead of `processWorklist`. That makes it easier to add items to the worklist multiple

[llvm-branch-commits] [mlir] [mlir][Interfaces][NFC] `ValueBoundsConstraintSet`: Delete dead code (PR #86098)

2024-03-21 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/86098 There is an assertion that the stop condition is not satisfied for the the starting point at the beginning of `computeBound`. Therefore, that case does not have to be handled later on in that

[llvm-branch-commits] [mlir] [mlir][sparse] Add `has_runtime_library` test op (PR #85355)

2024-03-14 Thread Matthias Springer via llvm-branch-commits
@@ -140,10 +140,16 @@ module { sparse_tensor.print %s1 : tensor<4x3x2xf32, #BatchedCSR> sparse_tensor.print %s2 : tensor<4x3x2xf32, #CSRDense> -// FIXME: doing this explicitly crashes runtime -// bufferization.dealloc_tensor %s0 : tensor<4x3x2xf32, #CCC> -

[llvm-branch-commits] [mlir] [mlir][sparse] Add `has_runtime_library` test op (PR #85355)

2024-03-14 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/85355 This commit adds a new test-only op: `sparse_tensor.has_runtime_library`. The op returns "1" if the sparse compiler runs in runtime library mode. This op is useful for writing test cases that require

[llvm-branch-commits] [mlir] [mlir][sparse] Fix memory leaks (part 3) (PR #85184)

2024-03-14 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/85184 This commit fixes memory leaks in sparse tensor integration tests by adding `bufferization.dealloc_tensor` ops. Note: Buffer deallocation will be automated in the future with the ownership-based

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Make `rewriterImpl` private in `IRRewrite` (PR #84865)

2024-03-11 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/84865 This commit makes `rewriterImpl` private in `IRRewrite`. This ensures that only the conversion value mapping and the dialect conversion configuration can be accessed from an IR rewrite object. >From

[llvm-branch-commits] [mlir] [mlir][Transforms] Support `replaceAllUsesWith` in dialect conversion (PR #84725)

2024-03-11 Thread Matthias Springer via llvm-branch-commits
@@ -751,6 +731,44 @@ class UnresolvedMaterializationRewrite : public OperationRewrite { /// The original output type. This is only used for argument conversions. Type origOutputType; }; + +/// A value rewrite. +class ValueRewrite : public IRRewrite { +public: + ///

[llvm-branch-commits] [mlir] [mlir][Transforms] Support `replaceAllUsesWith` in dialect conversion (PR #84725)

2024-03-11 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/84725 This commit adds support for `RewriterBase::replaceAllUsesWith` to the dialect conversion. Uses are not immediately replaced, but in a delayed fashion during the "commit" phase. No type conversions

[llvm-branch-commits] [mlir] [mlir][IR][NFC] Make `replaceAllUsesWith` non-templatized (PR #84722)

2024-03-10 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/84722 Turn `RewriterBase::replaceAllUsesWith` into a non-templatized implementation, so that it can be made virtual and be overridden in the `ConversionPatternRewriter` in a subsequent change. This change

[llvm-branch-commits] [mlir] [mlir][IR] Trigger `notifyOperationReplaced` on `replaceAllOpUsesWith` (PR #84721)

2024-03-10 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/84721 Before this change: `notifyOperationReplaced` was triggered when calling `RewriteBase::replaceOp`. After this change: `notifyOperationReplaced` is triggered when `RewriterBase::replaceAllOpUsesWith`

[llvm-branch-commits] [mlir] [mlir][Transform] Mapping update rules for `apply_conversion_patterns` (PR #84140)

2024-03-09 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/84140 >From e2b6b753bad33cbd03b79d3b9b4c2f0cabfbab8d Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Fri, 8 Mar 2024 02:09:29 + Subject: [PATCH] [mlir][Transform] Specify mapping update rules for

[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/84131 >From a65d640a0ca2c6810da0878ed42db39f27cebfe1 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Fri, 8 Mar 2024 07:19:33 + Subject: [PATCH] [mlir][IR] Add listener notifications for pattern

[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
@@ -68,9 +68,9 @@ class PatternApplicator { ///invalidate the match and try another pattern. LogicalResult matchAndRewrite(Operation *op, PatternRewriter , - function_ref canApply = {}, - function_ref onFailure = {}, -

[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/84131 >From 24a56caffaa23f6da73b129ca96f28e9a9bbf388 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Fri, 8 Mar 2024 07:19:33 + Subject: [PATCH] [mlir][IR] Add listener notifications for pattern

[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/84131 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
@@ -68,9 +68,9 @@ class PatternApplicator { ///invalidate the match and try another pattern. LogicalResult matchAndRewrite(Operation *op, PatternRewriter , - function_ref canApply = {}, - function_ref onFailure = {}, -

[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
@@ -68,9 +68,9 @@ class PatternApplicator { ///invalidate the match and try another pattern. LogicalResult matchAndRewrite(Operation *op, PatternRewriter , - function_ref canApply = {}, - function_ref onFailure = {}, -

[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/84131 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/84131 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
@@ -68,9 +68,9 @@ class PatternApplicator { ///invalidate the match and try another pattern. LogicalResult matchAndRewrite(Operation *op, PatternRewriter , - function_ref canApply = {}, - function_ref onFailure = {}, -

[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/84131 >From 0aef4b91f6aad0335e7eae2849edffd4338f4c40 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Fri, 8 Mar 2024 03:42:15 + Subject: [PATCH] [mlir][IR] Add listener notifications for pattern

[llvm-branch-commits] [mlir] [mlir][Transform] Mapping update rules for `apply_conversion_patterns` (PR #84140)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/84140 >From 515d86af51fdb10c957222f20f56bd3fa4e2c4d3 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Fri, 8 Mar 2024 02:09:29 + Subject: [PATCH] [mlir][Transform] Specify mapping update rules for

[llvm-branch-commits] [mlir] [mlir][Transform] Remove `notifyOperationErased` workaround (PR #84134)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/84134 >From 9f25fbb0bc012e8710242af0901a6416ce57e5ba Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Fri, 8 Mar 2024 02:06:22 + Subject: [PATCH] [mlir][Transform] Remove `notifyOperationErased`

[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

2024-03-07 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/84131 >From 407c7f7c24a87f409a921328605cc93637386d19 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Fri, 8 Mar 2024 02:01:50 + Subject: [PATCH] [mlir][IR] Add listener notifications for pattern

[llvm-branch-commits] [mlir] [mlir][Transform] Mapping update rules for `apply_conversion_patterns` (PR #84140)

2024-03-06 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/84140 This commit adds a new attribute to `transform.apply_conversion_patterns` that lets users specify how op handles should be updated if a tracked op is replaced during a dialect conversion.

[llvm-branch-commits] [mlir] [mlir][Transform] Remove `notifyOperationErased` workaround (PR #84134)

2024-03-06 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/84134 D144193 (#66771) has been merged. >From d9a6a5665c177185bafbe9cff264e28634b2b3e7 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Wed, 6 Mar 2024 08:09:22 + Subject: [PATCH]

[llvm-branch-commits] [mlir] [mlir][IR] Add listener notifications for pattern begin/end (PR #84131)

2024-03-06 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/84131 This commit adds two new notifications to `RewriterBase::Listener`: * `notifyPatternBegin`: Called when a pattern application begins during a greedy pattern rewrite or dialect conversion. *

[llvm-branch-commits] [mlir] [mlir][Transform] `apply_conversion_patterns`: Update handles (PR #83950)

2024-03-04 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/83950 Until now, `transform.apply_conversion_patterns` consumed the target handle and potentially invalidated handles. This commit adds tracking functionality similar to `transform.apply_patterns`, such

[llvm-branch-commits] [mlir] [mlir][Transforms] Add listener support to dialect conversion (PR #83425)

2024-03-04 Thread Matthias Springer via llvm-branch-commits
matthias-springer wrote: > > _[Reviewable](https://reviewable.io/reviews/llvm/llvm-project/83425)_ > > status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @ftynse, > > @joker-eph, and @matthias-springer) > > _[`mlir/lib/Transforms/Utils/DialectConversion.cpp` line 363 at >

[llvm-branch-commits] [mlir] [mlir][Transforms] Add listener support to dialect conversion (PR #83425)

2024-03-04 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/83425 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Transforms] Encapsulate dialect conversion options in `ConversionConfig` (PR #83754)

2024-03-03 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/83754 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Transforms] Add listener support to dialect conversion (PR #83425)

2024-02-29 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/83425 >From 22e8d5ea80b74d687c3e792c512f50b9de81f489 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Thu, 29 Feb 2024 12:58:26 + Subject: [PATCH] [mlir][Transforms] Add listener support to dialect

[llvm-branch-commits] [mlir] [mlir][Transforms] Add listener support to dialect conversion (PR #83425)

2024-02-29 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/83425 This commit adds listener support to the dialect conversion. Similarly to the greedy pattern rewrite driver, an optional listener can be specified in the configuration object. Listeners are notified

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Simplify handling of erased IR (PR #83423)

2024-02-29 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/83423 The dialect conversion uses a `SingleEraseRewriter` to ensure that an op/block is not erased twice. This can happen during the "commit" phase when an unresolved materialization is inserted into a

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Simplify `BlockTypeConversionRewrite` (PR #83286)

2024-02-28 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/83286 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Simplify `BlockTypeConversionRewrite` (PR #83286)

2024-02-28 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/83286 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Simplify `BlockTypeConversionRewrite` (PR #83286)

2024-02-28 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/83286 When a block signature is converted during dialect conversion a `BlockTypeConversionRewrite` object is stored in the stack of rewrites. Such an object represents multiple steps: - Splitting the old

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Remove `SplitBlockRewrite` (PR #82777)

2024-02-27 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/82777 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Turn unresolved materializations into `IRRewrite`s (PR #81761)

2024-02-22 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/81761 >From 6d02f6d545fff81a41b7e40fa48f19c55483c77b Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Mon, 19 Feb 2024 10:29:29 + Subject: [PATCH] [WIP] UnresolvedMaterialization BEGIN_PUBLIC No

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Turn op creation into `IRRewrite` (PR #81759)

2024-02-22 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/81759 >From d15c439f166426a613ac0021a9101b774d544357 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Fri, 16 Feb 2024 15:21:48 + Subject: [PATCH] [mlir][Transforms][NFC] Turn op creation into

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Turn op creation into `IRRewrite` (PR #81759)

2024-02-22 Thread Matthias Springer via llvm-branch-commits
@@ -2549,10 +2572,15 @@ LogicalResult OperationConverter::legalizeConvertedArgumentTypes( }); return liveUserIt == val.user_end() ? nullptr : *liveUserIt; }; - for (auto : rewriterImpl.rewrites) -if (auto *rewrite = dyn_cast(r.get())) - if

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Turn block type conversion into `IRRewrite` (PR #81756)

2024-02-21 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/81756 >From 68cb2590ea6295504b64d065326a606c2892a2a1 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Wed, 21 Feb 2024 16:48:48 + Subject: [PATCH] [mlir][Transforms][NFC] Turn block type convertion

[llvm-branch-commits] [mlir] [mlir][Transforms] Support rolling back properties in dialect conversion (PR #82474)

2024-02-21 Thread Matthias Springer via llvm-branch-commits
@@ -1002,12 +1002,31 @@ class ModifyOperationRewrite : public OperationRewrite { : OperationRewrite(Kind::ModifyOperation, rewriterImpl, op), loc(op->getLoc()), attrs(op->getAttrDictionary()), operands(op->operand_begin(), op->operand_end()), -

[llvm-branch-commits] [mlir] [mlir][Transforms] Support rolling back properties in dialect conversion (PR #82474)

2024-02-21 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/82474 >From 1795b6dcfdc0b6447c5209000332432de49109cc Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Wed, 21 Feb 2024 09:37:48 + Subject: [PATCH] [mlir][Transforms] Support rolling back properties

[llvm-branch-commits] [mlir] [mlir][Transforms] Support rolling back properties in dialect conversion (PR #82474)

2024-02-21 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/82474 >From f7a0cc4dd214b9f2b234ea5a61eaecdb19b6b3c4 Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Wed, 21 Feb 2024 09:37:48 + Subject: [PATCH] [mlir][Transforms] Support rolling back properties

[llvm-branch-commits] [mlir] [mlir][Transforms] Support rolling back properties in dialect conversion (PR #82474)

2024-02-21 Thread Matthias Springer via llvm-branch-commits
@@ -1002,12 +1002,31 @@ class ModifyOperationRewrite : public OperationRewrite { : OperationRewrite(Kind::ModifyOperation, rewriterImpl, op), loc(op->getLoc()), attrs(op->getAttrDictionary()), operands(op->operand_begin(), op->operand_end()), -

[llvm-branch-commits] [mlir] [mlir][Transforms] Support rolling back properties in dialect conversion (PR #82474)

2024-02-21 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/82474 >From 33f2ae9da319110ca8d2581ec6d66d2db83201cb Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Wed, 21 Feb 2024 08:41:44 + Subject: [PATCH] [mlir][Transforms] Support rolling back properties

[llvm-branch-commits] [mlir] [mlir][Transforms] Support rolling back properties in dialect conversion (PR #82474)

2024-02-21 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/82474 The dialect conversion rolls back in-place op modifications upon failure. Rolling back modifications of attributes is already supported, but there was no support for properties until now. >From

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Decouple `ConversionPatternRewriterImpl` from `ConversionPatternRewriter` (PR #82333)

2024-02-20 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/82333 `ConversionPatternRewriterImpl` no longer maintains a reference to the respective `ConversionPatternRewriter`. An `MLIRContext` is sufficient. This commit simplifies the internal state of

[llvm-branch-commits] [mlir] [mlir][Transforms] Encapsulate dialect conversion options in `ConversionConfig` (PR #82250)

2024-02-19 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/82250 This commit adds a new `ConversionConfig` struct that allows users to customize the dialect conversion. This configuration is similar to `GreedyRewriteConfig` for the greedy pattern rewrite driver. A

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Make `ConversionPatternRewriter` constructor private (PR #82244)

2024-02-19 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer updated https://github.com/llvm/llvm-project/pull/82244 >From f3fe2f1f9e2b561693bcaa2c8df84ac8cc8a60af Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Mon, 19 Feb 2024 12:50:30 + Subject: [PATCH] [mlir][Transforms] Make

[llvm-branch-commits] [mlir] [mlir][Transforms] Make `ConversionPatternRewriter` constructor private (PR #82244)

2024-02-19 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/82244 `ConversionPatternRewriter` objects should not be constructed outside of dialect conversions. Some IR modifications performed through a `ConversionPatternRewriter` are reflected in the IR in a delayed

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Turn unresolved materializations into `IRRewrite`s (PR #81761)

2024-02-19 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer edited https://github.com/llvm/llvm-project/pull/81761 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC][WIP] Turn unresolved materializations into `IRRewrite`s (PR #81761)

2024-02-19 Thread Matthias Springer via llvm-branch-commits
https://github.com/matthias-springer ready_for_review https://github.com/llvm/llvm-project/pull/81761 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

  1   2   >