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

2024-07-14 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 approved this pull request. 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: Make materializations optional (PR #104668)

2024-08-19 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 edited https://github.com/llvm/llvm-project/pull/104668 ___ 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: Make materializations optional (PR #104668)

2024-08-19 Thread Markus Böck via llvm-branch-commits
@@ -2447,6 +2487,37 @@ LogicalResult OperationConverter::convertOperations(ArrayRef ops) { } else { rewriterImpl.applyRewrites(); } + + // Gather all unresolved materializations. + SmallVector allCastOps; + DenseMap rewriteMap; + for (auto &rewrite : rewriterImpl.r

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Make materializations optional (PR #104668)

2024-08-19 Thread Markus Böck via llvm-branch-commits
@@ -702,14 +702,8 @@ class UnresolvedMaterializationRewrite : public OperationRewrite { return rewrite->getKind() == Kind::UnresolvedMaterialization; } - UnrealizedConversionCastOp getOperation() const { zero9178 wrote: I think it would be cleaner to

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Make materializations optional (PR #104668)

2024-08-19 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 approved this pull request. LGTM Slight nit in the PR description: Initially reading paragraph one and two had me confused whether the `ConversionConfig::buildMaterializations` knob and the "automatic materilization" as you called it were referring to the same thing

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Make materializations optional (PR #104668)

2024-08-19 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 edited https://github.com/llvm/llvm-project/pull/104668 ___ 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] release/18.x: [mlir] Skip invalid test on big endian platform (s390x) (#80246) (PR #81373)

2024-02-10 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 approved this pull request. https://github.com/llvm/llvm-project/pull/81373 ___ 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] Start moving some builtin type formats to the dialect (PR #80421)

2024-02-12 Thread Markus Böck via llvm-branch-commits
zero9178 wrote: ping https://github.com/llvm/llvm-project/pull/80421 ___ 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] PR for llvm/llvm-project#79797 (PR #79863)

2024-01-29 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 approved this pull request. https://github.com/llvm/llvm-project/pull/79863 ___ 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] PR for llvm/llvm-project#79600 (PR #79603)

2024-01-29 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 approved this pull request. (I think only release managers can merge to the release branch, not sure however) https://github.com/llvm/llvm-project/pull/79603 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.ll

[llvm-branch-commits] [mlir] [mlir] Start moving some builtin type formats to the dialect (PR #80421)

2024-02-02 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 created https://github.com/llvm/llvm-project/pull/80421 Most types and attributes in the builtin dialect are parsed and printed using special-purpose printers and parsers for that type. They also use the low-level `Printer` rather than the `AsmPrinter`, making the i

[llvm-branch-commits] [mlir] [mlir] Start moving some builtin type formats to the dialect (PR #80421)

2024-02-02 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 updated https://github.com/llvm/llvm-project/pull/80421 From e67e980cd077de77bb1683f4a9ad948f13ad4289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20B=C3=B6ck?= Date: Fri, 2 Feb 2024 12:47:05 +0100 Subject: [PATCH] [mlir] Start moving some builtin type formats to

[llvm-branch-commits] [mlir] [mlir] Start moving some builtin type formats to the dialect (PR #80421)

2024-02-02 Thread Markus Böck via llvm-branch-commits
@@ -25,7 +25,8 @@ include "mlir/IR/BuiltinTypeInterfaces.td" // Base class for Builtin dialect types. class Builtin_Type traits = [], string baseCppClass = "::mlir::Type"> -: TypeDef { +: TypeDef`) since the logic currently assumes that verbose types

[llvm-branch-commits] [mlir] a7eab64 - [mlir] Change ABI breaking use of NDEBUG to LLVM_ENABLE_ABI_BREAKING_CHECKS

2021-08-03 Thread Markus Böck via llvm-branch-commits
Author: Markus Böck Date: 2021-08-03T09:14:57+02:00 New Revision: a7eab64b7c45d40154ec6f04d3a1f38b13dacfab URL: https://github.com/llvm/llvm-project/commit/a7eab64b7c45d40154ec6f04d3a1f38b13dacfab DIFF: https://github.com/llvm/llvm-project/commit/a7eab64b7c45d40154ec6f04d3a1f38b13dacfab.diff L

[llvm-branch-commits] [mlir] [mlir][Transforms] Merge 1:1 and 1:N type converters (PR #113032)

2024-10-19 Thread Markus Böck via llvm-branch-commits
@@ -409,32 +419,50 @@ class TypeConverter { /// callback. /// /// With callback of form: - /// `Value(OpBuilder &, T, ValueRange, Location, Type)` + /// - Value(OpBuilder &, T, ValueRange, Location, Type) + /// - SmallVector(OpBuilder &, TypeRange, ValueRange, Location

[llvm-branch-commits] [mlir] [mlir][Transforms] Merge 1:1 and 1:N type converters (PR #113032)

2024-10-19 Thread Markus Böck via llvm-branch-commits
@@ -409,32 +419,50 @@ class TypeConverter { /// callback. /// /// With callback of form: - /// `Value(OpBuilder &, T, ValueRange, Location, Type)` + /// - Value(OpBuilder &, T, ValueRange, Location, Type) + /// - SmallVector(OpBuilder &, TypeRange, ValueRange, Location

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)

2024-11-12 Thread Markus Böck via llvm-branch-commits
@@ -1390,8 +1412,9 @@ void ConversionPatternRewriterImpl::notifyOpReplaced(Operation *op, isUnresolvedMaterialization = true; // Create mappings for each of the new result values. - for (auto [newValue, result] : llvm::zip(newValues, op->getResults())) { -if (!ne

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)

2024-11-12 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 edited https://github.com/llvm/llvm-project/pull/115816 ___ 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: Add `replaceOpWithMultiple` (PR #115816)

2024-11-12 Thread Markus Böck via llvm-branch-commits
@@ -618,21 +618,27 @@ class SparseCallConverter : public OpConversionPattern { assert(!sparseFlat.empty()); if (sparseFlat.size() > 1) { auto flatSize = sparseFlat.size(); -ValueRange fields(iterator_range( -newCall.result_begin() + retO

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)

2024-11-12 Thread Markus Böck via llvm-branch-commits
@@ -618,21 +618,27 @@ class SparseCallConverter : public OpConversionPattern { assert(!sparseFlat.empty()); if (sparseFlat.size() > 1) { auto flatSize = sparseFlat.size(); -ValueRange fields(iterator_range( -newCall.result_begin() + retO

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)

2024-11-12 Thread Markus Böck via llvm-branch-commits
@@ -1497,15 +1530,33 @@ void ConversionPatternRewriter::replaceOp(Operation *op, ValueRange newValues) { impl->logger.startLine() << "** Replace : '" << op->getName() << "'(" << op << ")\n"; }); - impl->notifyOpReplaced(op, newValues); + SmallVector newVals(new

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)

2024-11-12 Thread Markus Böck via llvm-branch-commits
@@ -795,12 +795,32 @@ class ConversionPatternRewriter final : public PatternRewriter { /// patterns even if a failure is encountered during the rewrite step. bool canRecoverFromRewriteFailure() const override { return true; } - /// PatternRewriter hook for replacing an o

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)

2024-11-12 Thread Markus Böck via llvm-branch-commits
zero9178 wrote: Should the changes here be part of the other PR? https://github.com/llvm/llvm-project/pull/115816 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)

2024-11-12 Thread Markus Böck via llvm-branch-commits
@@ -1417,12 +1441,21 @@ void ConversionPatternRewriterImpl::notifyOpReplaced(Operation *op, } // Remap result to replacement value. -if (newValue) - mapping.map(result, newValue); +if (!repl.empty()) { + if (repl.size() == 1) { +// Single rep

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)

2024-11-12 Thread Markus Böck via llvm-branch-commits
@@ -618,21 +618,27 @@ class SparseCallConverter : public OpConversionPattern { assert(!sparseFlat.empty()); if (sparseFlat.size() > 1) { auto flatSize = sparseFlat.size(); -ValueRange fields(iterator_range( -newCall.result_begin() + retO

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)

2024-11-12 Thread Markus Böck via llvm-branch-commits
@@ -1497,15 +1530,33 @@ void ConversionPatternRewriter::replaceOp(Operation *op, ValueRange newValues) { impl->logger.startLine() << "** Replace : '" << op->getName() << "'(" << op << ")\n"; }); - impl->notifyOpReplaced(op, newValues); + SmallVector newVals(new

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)

2024-11-12 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 commented: Looks mostly good to me besides some code nits :slightly_smiling_face: The only very high level conern I have is the use and need of `InsertionPoint::after`. As I understand, this is a not-yet-implemented optimization for the future for the purpose of re

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect Conversion: Add `replaceOpWithMultiple` (PR #115816)

2024-11-12 Thread Markus Böck via llvm-branch-commits
@@ -795,12 +795,32 @@ class ConversionPatternRewriter final : public PatternRewriter { /// patterns even if a failure is encountered during the rewrite step. bool canRecoverFromRewriteFailure() const override { return true; } - /// PatternRewriter hook for replacing an o

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Dialect Conversion: Simplify `finalize` signature (PR #110419)

2024-09-30 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 approved this pull request. https://github.com/llvm/llvm-project/pull/110419 ___ 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][LLVM] `LLVMTypeConverter`: Tighten materialization checks (PR #116532)

2024-11-18 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 approved this pull request. LGTM, thank you :)) https://github.com/llvm/llvm-project/pull/116532 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-br

[llvm-branch-commits] [mlir] [mlir][Transforms] Add 1:N `matchAndRewrite` overload (PR #116470)

2024-11-18 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 approved this pull request. LGTM, thank you! https://github.com/llvm/llvm-project/pull/116470 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branc

[llvm-branch-commits] [mlir] [mlir][LLVM] `LLVMTypeConverter`: Tighten materialization checks (PR #116532)

2024-11-17 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 edited https://github.com/llvm/llvm-project/pull/116532 ___ 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][LLVM] `LLVMTypeConverter`: Tighten materialization checks (PR #116532)

2024-11-17 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 commented: Makes sense to me from a defensive programming perspective, but shouldn't a user add their own argument materialization in this case that can handle their type conversion and have that be called first? Is there an easy way we can test this by any chance?

[llvm-branch-commits] [mlir] [mlir][Transforms] Add 1:N `matchAndRewrite` overload (PR #116470)

2024-11-17 Thread Markus Böck via llvm-branch-commits
@@ -1538,10 +1607,9 @@ void ConversionPatternRewriter::replaceOp(Operation *op, ValueRange newValues) { impl->logger.startLine() << "** Replace : '" << op->getName() << "'(" << op << ")\n"; }); - SmallVector newVals(newValues.size()); - for (auto [index, val] :

[llvm-branch-commits] [mlir] [mlir][Transforms] Add 1:N `matchAndRewrite` overload (PR #116470)

2024-11-16 Thread Markus Böck via llvm-branch-commits
@@ -1733,12 +1819,14 @@ ConversionPattern::matchAndRewrite(Operation *op, getTypeConverter()); // Remap the operands of the operation. - SmallVector operands; + SmallVector> remapped; if (failed(rewriterImpl.remapValues("oper

[llvm-branch-commits] [mlir] [mlir][Transforms] Add 1:N `matchAndRewrite` overload (PR #116470)

2024-11-16 Thread Markus Böck via llvm-branch-commits
@@ -1965,19 +2053,19 @@ OperationLegalizer::legalizeWithFold(Operation *op, }); // Try to fold the operation. - SmallVector replacementValues; + SmallVector ValueRange; zero9178 wrote: ```suggestion SmallVector valueRange; ``` https://github.com/llvm

[llvm-branch-commits] [mlir] [mlir][Transforms] Add 1:N `matchAndRewrite` overload (PR #116470)

2024-11-16 Thread Markus Böck via llvm-branch-commits
@@ -537,6 +537,10 @@ class ConversionPattern : public RewritePattern { ConversionPatternRewriter &rewriter) const { llvm_unreachable("unimplemented rewrite"); } + virtual void rewrite(Operation *op, ArrayRef operands, zero9178 wrot

[llvm-branch-commits] [mlir] [mlir][Transforms] Add 1:N `matchAndRewrite` overload (PR #116470)

2024-11-16 Thread Markus Böck via llvm-branch-commits
@@ -1145,15 +1170,32 @@ LogicalResult ConversionPatternRewriterImpl::remapValues( return failure(); } +// If a type is converted to 0 types, there is nothing to do. +if (legalTypes.empty()) { + remapped.push_back({}); + continue; +} + if (

[llvm-branch-commits] [mlir] [mlir][Transforms] Add 1:N `matchAndRewrite` overload (PR #116470)

2024-11-16 Thread Markus Böck via llvm-branch-commits
@@ -1376,14 +1423,36 @@ void ConversionPatternRewriterImpl::insertNTo1Materialization( legalOutputType = replacements[0].getType(); } if (legalOutputType && legalOutputType != originalType) { +UnrealizedConversionCastOp targetCastOp; Value targetMat = buildUnr

[llvm-branch-commits] [mlir] [mlir][Transforms] Add 1:N `matchAndRewrite` overload (PR #116470)

2024-11-16 Thread Markus Böck via llvm-branch-commits
@@ -1538,10 +1607,9 @@ void ConversionPatternRewriter::replaceOp(Operation *op, ValueRange newValues) { impl->logger.startLine() << "** Replace : '" << op->getName() << "'(" << op << ")\n"; }); - SmallVector newVals(newValues.size()); - for (auto [index, val] :

[llvm-branch-commits] [mlir] [mlir] Add predicates to tablegen-defined properties (PR #120176)

2024-12-17 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 commented: Looks great to me, thank you! I added a few comments but they're all implementation details, no conceptual complaints from my side. Also adding Jeff as a reviewer given the disucssion at https://github.com/llvm/llvm-project/pull/94732 https://github.com/

[llvm-branch-commits] [mlir] [mlir] Add predicates to tablegen-defined properties (PR #120176)

2024-12-17 Thread Markus Böck via llvm-branch-commits
@@ -63,6 +65,12 @@ class Property { return convertFromAttribute($_storage, $_attr, $_diag); }]; + // The verification predicate for this property. Defaults to And<[]>, + // which is trivially true, since properties are always their expected type. + // Within the predi

[llvm-branch-commits] [mlir] [mlir] Add predicates to tablegen-defined properties (PR #120176)

2024-12-17 Thread Markus Böck via llvm-branch-commits
@@ -1033,6 +1033,60 @@ while (true) {{ emitVerifier(namedAttr.attr, namedAttr.name, getVarName(namedAttr.name)); } +static void genPropertyVerifier(const OpOrAdaptorHelper &emitHelper, +FmtContext &ctx, MethodBody &body) { + + // Code to

[llvm-branch-commits] [mlir] [mlir] Add predicates to tablegen-defined properties (PR #120176)

2024-12-17 Thread Markus Böck via llvm-branch-commits
@@ -1033,6 +1033,60 @@ while (true) {{ emitVerifier(namedAttr.attr, namedAttr.name, getVarName(namedAttr.name)); } +static void genPropertyVerifier(const OpOrAdaptorHelper &emitHelper, +FmtContext &ctx, MethodBody &body) { + + // Code to

[llvm-branch-commits] [mlir] [mlir] Add predicates to tablegen-defined properties (PR #120176)

2024-12-17 Thread Markus Böck via llvm-branch-commits
@@ -1033,6 +1033,60 @@ while (true) {{ emitVerifier(namedAttr.attr, namedAttr.name, getVarName(namedAttr.name)); } +static void genPropertyVerifier(const OpOrAdaptorHelper &emitHelper, +FmtContext &ctx, MethodBody &body) { + + // Code to

[llvm-branch-commits] [mlir] [mlir] Add predicates to tablegen-defined properties (PR #120176)

2024-12-17 Thread Markus Böck via llvm-branch-commits
@@ -1033,6 +1033,60 @@ while (true) {{ emitVerifier(namedAttr.attr, namedAttr.name, getVarName(namedAttr.name)); } +static void genPropertyVerifier(const OpOrAdaptorHelper &emitHelper, +FmtContext &ctx, MethodBody &body) { + + // Code to

[llvm-branch-commits] [mlir] [mlir] Add predicates to tablegen-defined properties (PR #120176)

2024-12-17 Thread Markus Böck via llvm-branch-commits
@@ -342,14 +399,37 @@ class _makePropStorage { true : "") # ";"; } +/// Construct a `Pred`icate `ret` that wraps the predicate of the underlying +/// property `childProp` with: +/// +/// [](childProp.storageType& s) { +/// return [](childProp.interfaceType i) { +

[llvm-branch-commits] [mlir] [mlir] Add predicates to tablegen-defined properties (PR #120176)

2024-12-17 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 edited https://github.com/llvm/llvm-project/pull/120176 ___ 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] Add predicates to tablegen-defined properties (PR #120176)

2024-12-17 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 edited https://github.com/llvm/llvm-project/pull/120176 ___ 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] Add predicates to tablegen-defined properties (PR #120176)

2024-12-17 Thread Markus Böck via llvm-branch-commits
@@ -63,6 +65,12 @@ class Property { return convertFromAttribute($_storage, $_attr, $_diag); }]; + // The verification predicate for this property. Defaults to And<[]>, + // which is trivially true, since properties are always their expected type. + // Within the predi

[llvm-branch-commits] [mlir] [mlir] Add predicates to tablegen-defined properties (PR #120176)

2024-12-17 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 edited https://github.com/llvm/llvm-project/pull/120176 ___ 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] Add predicates to tablegen-defined properties (PR #120176)

2024-12-17 Thread Markus Böck via llvm-branch-commits
@@ -63,6 +65,12 @@ class Property { return convertFromAttribute($_storage, $_attr, $_diag); }]; + // The verification predicate for this property. Defaults to And<[]>, + // which is trivially true, since properties are always their expected type. + // Within the predi

[llvm-branch-commits] [mlir] [mlir][Properties] Shorten "Property" to "Prop" in most places (PR #120368)

2024-12-18 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 edited https://github.com/llvm/llvm-project/pull/120368 ___ 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][Properties] Shorten "Property" to "Prop" in most places (PR #120368)

2024-12-18 Thread Markus Böck via llvm-branch-commits
@@ -113,13 +113,13 @@ struct AttributeLikeVariable : public VariableElement { return isa(fe) && classof(cast(fe)); } - /// Returns true if the variable is a UnitAttr or a UnitProperty. + /// Returns true if the variable is a UnitAttr or a UnitProp. bool isUnit() con

[llvm-branch-commits] [mlir] [mlir][Properties] Shorten "Property" to "Prop" in most places (PR #120368)

2024-12-18 Thread Markus Böck via llvm-branch-commits
@@ -102,8 +102,9 @@ their semantics via a special [TableGen backend][TableGenBackend]: constraints over attributes. A notable subclass hierarchy is `Attr`, which stands for constraints for attributes whose values are of common types. * The `Property` class hierarchy:

[llvm-branch-commits] [mlir] [mlir][Properties] Shorten "Property" to "Prop" in most places (PR #120368)

2024-12-18 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 commented: I am personally in favour of this and besides the past, there probably isn't a better time to do this change than now. I also really like that this only deprecates the old names such that downstream users are notified on their next bump and it can then be

[llvm-branch-commits] [mlir] [mlir][CF] Split `cf-to-llvm` from `func-to-llvm` (PR #120580)

2024-12-19 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/120580 ___ 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][CF] Split `cf-to-llvm` from `func-to-llvm` (PR #120580)

2024-12-19 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 edited https://github.com/llvm/llvm-project/pull/120580 ___ 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][CF] Split `cf-to-llvm` from `func-to-llvm` (PR #120580)

2024-12-19 Thread Markus Böck via llvm-branch-commits
@@ -94,106 +94,111 @@ struct AssertOpLowering : public ConvertOpToLLVMPattern { bool abortOnFailedAssert = true; }; -/// The cf->LLVM lowerings for branching ops require that the blocks they jump -/// to first have updated types which should be handled by a pattern operatin

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -63,80 +113,140 @@ static OpBuilder::InsertPoint computeInsertPoint(Value value) { return OpBuilder::InsertPoint(insertBlock, insertPt); } +/// Helper function that computes an insertion point where the given values are +/// defined and can be used without a dominance vi

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -63,80 +113,140 @@ static OpBuilder::InsertPoint computeInsertPoint(Value value) { return OpBuilder::InsertPoint(insertBlock, insertPt); } +/// Helper function that computes an insertion point where the given values are +/// defined and can be used without a dominance vi

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -1192,51 +1256,28 @@ LogicalResult ConversionPatternRewriterImpl::remapValues( }); return failure(); } - // If a type is converted to 0 types, there is nothing to do. if (legalTypes.empty()) { remapped.push_back({}); continue; }

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -63,80 +113,140 @@ static OpBuilder::InsertPoint computeInsertPoint(Value value) { return OpBuilder::InsertPoint(insertBlock, insertPt); } +/// Helper function that computes an insertion point where the given values are +/// defined and can be used without a dominance vi

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -1478,34 +1497,12 @@ Value ConversionPatternRewriterImpl::findOrBuildReplacementValue( } Value castValue = buildUnresolvedMaterialization( MaterializationKind::Source, computeInsertPoint(repl), value.getLoc(), - /*valueToMap=*/value, /*inputs=*/repl, /*output

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -1192,51 +1256,28 @@ LogicalResult ConversionPatternRewriterImpl::remapValues( }); return failure(); } - // If a type is converted to 0 types, there is nothing to do. if (legalTypes.empty()) { remapped.push_back({}); continue; }

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -63,80 +113,140 @@ static OpBuilder::InsertPoint computeInsertPoint(Value value) { return OpBuilder::InsertPoint(insertBlock, insertPt); } +/// Helper function that computes an insertion point where the given values are +/// defined and can be used without a dominance vi

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -1478,34 +1497,12 @@ Value ConversionPatternRewriterImpl::findOrBuildReplacementValue( } Value castValue = buildUnresolvedMaterialization( MaterializationKind::Source, computeInsertPoint(repl), value.getLoc(), zero9178 wrote: ```suggestion

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -63,80 +113,140 @@ static OpBuilder::InsertPoint computeInsertPoint(Value value) { return OpBuilder::InsertPoint(insertBlock, insertPt); } +/// Helper function that computes an insertion point where the given values are +/// defined and can be used without a dominance vi

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -1101,18 +1172,18 @@ void CreateOperationRewrite::rollback() { UnresolvedMaterializationRewrite::UnresolvedMaterializationRewrite( ConversionPatternRewriterImpl &rewriterImpl, UnrealizedConversionCastOp op, const TypeConverter *converter, MaterializationKind kind, Ty

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -63,80 +113,140 @@ static OpBuilder::InsertPoint computeInsertPoint(Value value) { return OpBuilder::InsertPoint(insertBlock, insertPt); } +/// Helper function that computes an insertion point where the given values are +/// defined and can be used without a dominance vi

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -1423,37 +1458,21 @@ ValueRange ConversionPatternRewriterImpl::buildUnresolvedMaterialization( builder.setInsertionPoint(ip.getBlock(), ip.getPoint()); auto convertOp = builder.create(loc, outputTypes, inputs); - if (valueToMap) { -assert(outputTypes.size() =

[llvm-branch-commits] [flang] [mlir] [mlir][Transforms] Support 1:N mappings in `ConversionValueMapping` (PR #116524)

2024-12-21 Thread Markus Böck via llvm-branch-commits
@@ -1192,51 +1256,28 @@ LogicalResult ConversionPatternRewriterImpl::remapValues( }); return failure(); } - // If a type is converted to 0 types, there is nothing to do. if (legalTypes.empty()) { remapped.push_back({}); continue; }

[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Use `DominanceInfo` to compute materialization insertion point (PR #120746)

2025-01-03 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/120746 ___ 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] [llvm] [mlir] [mlir][Transforms] Delete 1:N dialect conversion driver (PR #121389)

2024-12-31 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 approved this pull request. I love the colour red https://github.com/llvm/llvm-project/pull/121389 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-

[llvm-branch-commits] [mlir] [mlir][memref] Check memory space before lowering alloc ops (PR #134427)

2025-04-05 Thread Markus Böck via llvm-branch-commits
@@ -75,9 +75,11 @@ class ConvertToLLVMPattern : public ConversionPattern { ValueRange indices, ConversionPatternRewriter &rewriter) const; - /// Returns if the given memref has identity maps and the element type is -

[llvm-branch-commits] [mlir] [mlir][memref] Check memory space before lowering alloc ops (PR #134427)

2025-04-05 Thread Markus Böck via llvm-branch-commits
@@ -22,7 +22,7 @@ func.func @bad_address_space(%a: memref<2xindex, "foo">) { // CHECK-LABEL: @invalid_int_conversion func.func @invalid_int_conversion() { - // expected-error@+1 {{conversion of memref memory space 1 : ui64 to integer address space failed. Consider adding

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Add flag to disable rollback (PR #136490)

2025-04-21 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/136490 ___ 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: Add flag to disable rollback (PR #136490)

2025-04-21 Thread Markus Böck via llvm-branch-commits
https://github.com/zero9178 edited https://github.com/llvm/llvm-project/pull/136490 ___ 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: Add flag to disable rollback (PR #136490)

2025-04-21 Thread Markus Böck via llvm-branch-commits
@@ -1216,10 +1220,19 @@ void ConversionPatternRewriterImpl::resetState(RewriterState state) { replacedOps.pop_back(); } -void ConversionPatternRewriterImpl::undoRewrites(unsigned numRewritesToKeep) { +void ConversionPatternRewriterImpl::undoRewrites(unsigned numRewritesTo