[llvm-branch-commits] [flang] [mlir] [MLIR] Add new complex.powi op (PR #158722)

2025-09-18 Thread Mehdi Amini via llvm-branch-commits
@@ -47,74 +47,61 @@ static func::FuncOp getOrDeclare(fir::FirOpBuilder &builder, Location loc, return func; } -static bool isZero(Value v) { - if (auto cst = v.getDefiningOp()) -if (auto attr = dyn_cast(cst.getValue())) - return attr.getValue().isZero(); - return

[llvm-branch-commits] [flang] [mlir] [MLIR] Add new complex.powi op (PR #158722)

2025-09-18 Thread Mehdi Amini via llvm-branch-commits
joker-eph wrote: > > That isn't in MLIR right now, so that's not generally usable. > > I've added `complex.powi -> complex.pow` conversion to the > `ComplexToStandard` MLIR pass. Thanks, LG! https://github.com/llvm/llvm-project/pull/158722 ___ llvm-

[llvm-branch-commits] [flang] [mlir] [MLIR] Add new complex.powi op (PR #158722)

2025-09-17 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph edited https://github.com/llvm/llvm-project/pull/158722 ___ 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] [flang] [mlir] [MLIR] Add new complex.powi op (PR #158722)

2025-09-15 Thread Mehdi Amini via llvm-branch-commits
@@ -443,6 +443,32 @@ def PowOp : ComplexArithmeticOp<"pow"> { }]; } +//===--===// +// PowiOp +//===--===// + +def PowiOp : Complex_Op<"powi

[llvm-branch-commits] [flang] [mlir] [MLIR] Add new complex.powi op (PR #158722)

2025-09-15 Thread Mehdi Amini via llvm-branch-commits
joker-eph wrote: What is the LLVM lowering here? https://github.com/llvm/llvm-project/pull/158722 ___ 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] [NFC][mlir][ptr] Clarify pointer dialect semantics (PR #158484)

2025-09-14 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/158484 ___ 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][ptr] Extend `ptr_add` operation to support shaped operands (PR #156374)

2025-09-03 Thread Mehdi Amini via llvm-branch-commits
@@ -23,6 +24,41 @@ class LLVM_Attrhttps://github.com/llvm/llvm-project/pull/156374 ___ 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][ptr] Extend `ptr_add` operation to support shaped operands (PR #156374)

2025-09-03 Thread Mehdi Amini via llvm-branch-commits
@@ -23,6 +24,41 @@ class LLVM_Attrhttps://github.com/llvm/llvm-project/pull/156374 ___ 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][ptr] Add translations to LLVMIR for ptr ops. (PR #156355)

2025-09-03 Thread Mehdi Amini via llvm-branch-commits
@@ -16,11 +16,197 @@ #include "mlir/IR/BuiltinAttributes.h" #include "mlir/IR/Operation.h" #include "mlir/Target/LLVMIR/ModuleTranslation.h" +#include "llvm/ADT/TypeSwitch.h" +#include "llvm/IR/IRBuilder.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/Type.h" +#include

[llvm-branch-commits] [mlir] [mlir][ptr] Add `gather`, `masked_load`, `masked_store`, and `scatter` ops (PR #156368)

2025-09-02 Thread Mehdi Amini via llvm-branch-commits
@@ -17,6 +17,46 @@ include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/Interfaces/ViewLikeInterface.td" include "mlir/IR/OpAsmInterface.td" +//===--===// +// Common props +//===

[llvm-branch-commits] [mlir] [mlir][ptr] Add `gather`, `masked_load`, `masked_store`, and `scatter` ops (PR #156368)

2025-09-02 Thread Mehdi Amini via llvm-branch-commits
@@ -56,6 +96,58 @@ def Ptr_FromPtrOp : Pointer_Op<"from_ptr", [ let hasVerifier = 1; } +//===--===// +// GatherOp +//===--===// + +def Ptr_

[llvm-branch-commits] [mlir] [mlir][ptr] Add `gather`, `masked_load`, `masked_store`, and `scatter` ops (PR #156368)

2025-09-02 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/156368 ___ 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][ptr] Add `gather`, `masked_load`, `masked_store`, and `scatter` ops (PR #156368)

2025-09-02 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/156368 ___ 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][ptr] Add `gather`, `masked_load`, `masked_store`, and `scatter` ops (PR #156368)

2025-09-02 Thread Mehdi Amini via llvm-branch-commits
@@ -56,6 +96,58 @@ def Ptr_FromPtrOp : Pointer_Op<"from_ptr", [ let hasVerifier = 1; } +//===--===// +// GatherOp +//===--===// + +def Ptr_

[llvm-branch-commits] [mlir] [mlir][ptr] Add translations to LLVMIR for ptr ops. (PR #156355)

2025-09-02 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. LG overall https://github.com/llvm/llvm-project/pull/156355 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-com

[llvm-branch-commits] [mlir] release/21.x: [mlir][cmake] Fix mlir target export (#153341) (PR #155856)

2025-08-29 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph edited https://github.com/llvm/llvm-project/pull/155856 ___ 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 bug fixes for LLVM 21.x release (PR #154587)

2025-08-25 Thread Mehdi Amini via llvm-branch-commits
joker-eph wrote: If you look at the diff and fold the MLIR folder, you'll see that there is nothing outside of MLIR in this diff. https://github.com/llvm/llvm-project/pull/154587 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [mlir] MLIR bug fixes for LLVM 21.x release (PR #154587)

2025-08-21 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph milestoned https://github.com/llvm/llvm-project/pull/154587 ___ 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 bug fixes for LLVM 21.x release (PR #154587)

2025-08-20 Thread Mehdi Amini via llvm-branch-commits
joker-eph wrote: @tru : I haven't done release cherry-pick for a while, so I'm not sure about the current process to get this merged, is this on you? Do I need to ping you or are you going through these PRs on a regular basis? https://github.com/llvm/llvm-project/pull/154587 __

[llvm-branch-commits] [mlir] MLIR bug fixes for LLVM 21.x release (PR #154587)

2025-08-20 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph created https://github.com/llvm/llvm-project/pull/154587 I went through the recent bug fixes in MLIR and cherry-picked the ones that seems good to have for the 21.x branch. >From 877642f0b5018d0922dbbb72d95f1eefffbe09fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=

[llvm-branch-commits] [mlir] release/21.x: [mlir] Make parser not rely on terminating null. (#151007) (PR #154551)

2025-08-20 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/154551 ___ 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] Stop visiting unreachable blocks in the walkAndApplyPatterns driver (PR #154038)

2025-08-18 Thread Mehdi Amini via llvm-branch-commits
@@ -119,3 +119,18 @@ func.func @erase_nested_block() -> i32 { }): () -> (i32) return %a : i32 } + + +// CHECK-LABEL: func.func @unreachable_replace_with_new_op +// CHECK: "test.new_op" +// CHECK: "test.replace_with_new_op" +func.func @unreachable_replace_with_new_op() { +

[llvm-branch-commits] [mlir] [MLIR] Stop visiting unreachable blocks in the walkAndApplyPatterns driver (PR #154038)

2025-08-18 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph updated https://github.com/llvm/llvm-project/pull/154038 >From a33b1af2c37a62191ba346c43ec238e7e653d29e Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sun, 17 Aug 2025 14:24:35 -0700 Subject: [PATCH] [MLIR] Stop visiting unreachable blocks in the walkAndApplyPatt

[llvm-branch-commits] [mlir] [MLIR] Stop visiting unreachable blocks in the walkAndApplyPatterns driver (PR #154038)

2025-08-17 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph updated https://github.com/llvm/llvm-project/pull/154038 >From 7260f9263133579e45e704ca2f42883770b0221a Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sun, 17 Aug 2025 14:24:35 -0700 Subject: [PATCH] [MLIR] Stop visiting unreachable blocks in the walkAndApplyPatt

[llvm-branch-commits] [mlir] [MLIR] Stop visiting unreachable blocks in the walkAndApplyPatterns driver (PR #154038)

2025-08-17 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph updated https://github.com/llvm/llvm-project/pull/154038 >From e5070afea324c3fa3bde2b2da3e605a7d8c43c7c Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sun, 17 Aug 2025 14:24:35 -0700 Subject: [PATCH] [MLIR] Stop visiting unreachable blocks in the walkAndApplyPatt

[llvm-branch-commits] [mlir] [MLIR] Stop visiting unreachable blocks in the walkAndApplyPatterns driver (PR #154038)

2025-08-17 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph created https://github.com/llvm/llvm-project/pull/154038 This is similar to the fix to the greedy driver in #153957 ; except that instead of removing unreachable code, we just ignore it. Operations like: ``` %add = arith.addi %add, %add : i64 ``` are legal in unr

[llvm-branch-commits] [mlir] bc613cb - Revert "[MLIR] Split ExecutionEngine Initialization out of ctor into an expli…"

2025-08-13 Thread Mehdi Amini via llvm-branch-commits
Author: Mehdi Amini Date: 2025-08-13T12:42:57-07:00 New Revision: bc613cbb6a0ab1637af76249906beb6369807105 URL: https://github.com/llvm/llvm-project/commit/bc613cbb6a0ab1637af76249906beb6369807105 DIFF: https://github.com/llvm/llvm-project/commit/bc613cbb6a0ab1637af76249906beb6369807105.diff L

[llvm-branch-commits] [mlir] [mlir] Unique property constraints where possible (PR #140849)

2025-05-30 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. Nice! https://github.com/llvm/llvm-project/pull/140849 ___ 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] [Github][CI] Make the new premerge system fail jobs on errors (PR #139359)

2025-05-10 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/139359 ___ 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] Add missing imports (PR #138550)

2025-05-06 Thread Mehdi Amini via llvm-branch-commits
joker-eph wrote: In general, I believe we cherry-pick fixes commits from `main` instead of rewriting patches directly to the release branch. https://github.com/llvm/llvm-project/pull/138550 ___ llvm-branch-commits mailing list llvm-branch-commits@list

[llvm-branch-commits] [mlir] [mlir][GPU] Add `gpu.assert` op (PR #120431)

2024-12-18 Thread Mehdi Amini via llvm-branch-commits
joker-eph wrote: Can we just use cf.assert ? https://github.com/llvm/llvm-project/pull/120431 ___ 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 Mehdi Amini via llvm-branch-commits
@@ -330,6 +337,56 @@ def UnitProperty : Property<"bool", "unit property"> { }]; } +//===--===// +// Property field overwrites + +/// Class for giving a property a default value. +/// This doesn't change anyt

[llvm-branch-commits] [mlir] [mlir][IR][NFC] `PostDominanceInfo`: Mark all functions as `const` (PR #115597)

2024-11-10 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/115597 ___ 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 helper functions to compute insertion point (PR #114940)

2024-11-08 Thread Mehdi Amini via llvm-branch-commits
@@ -641,3 +641,76 @@ void OpBuilder::cloneRegionBefore(Region ®ion, Region &parent, void OpBuilder::cloneRegionBefore(Region ®ion, Block *before) { cloneRegionBefore(region, *before->getParent(), before->getIterator()); } + +//===-

[llvm-branch-commits] [mlir] [mlir][IR] Add helper functions to compute insertion point (PR #114940)

2024-11-08 Thread Mehdi Amini via llvm-branch-commits
@@ -334,6 +334,18 @@ class OpBuilder : public Builder { /// This class represents a saved insertion point. class InsertPoint { public: +/// Finds the closest insertion point where all given values are defined joker-eph wrote: It's not clear to me tha

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Unify materialization of value replacements (PR #108381)

2024-09-12 Thread Mehdi Amini via llvm-branch-commits
@@ -558,8 +558,8 @@ func.func @deinterleave(%a: vector<4xf32>) -> (vector<2xf32>, vector<2xf32>) { // CHECK-LABEL: func @deinterleave_scalar // CHECK-SAME: (%[[ARG0:.+]]: vector<2xf32>) -// CHECK: %[[EXTRACT0:.*]] = spirv.CompositeExtract %[[ARG0]][0 : i32] : vector<2x

[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Unify materialization of value replacements (PR #108381)

2024-09-12 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/108381 ___ 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] Dialect conversion: Cache `UnresolvedMaterializationRewrite` (PR #108359)

2024-09-12 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/108359 ___ 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] Dialect conversion: Cache `UnresolvedMaterializationRewrite` (PR #108359)

2024-09-12 Thread Mehdi Amini via llvm-branch-commits
@@ -935,8 +909,10 @@ struct ConversionPatternRewriterImpl : public RewriterBase::Listener { /// to modify/access them is invalid rewriter API usage. SetVector replacedOps; - /// A set of all unresolved materializations. - DenseSet unresolvedMaterializations; + /// A ma

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

2024-05-29 Thread Mehdi Amini 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 Mehdi Amini via llvm-branch-commits
@@ -1053,3 +1055,241 @@ LogicalResult mlir::applyOpPatternsAndFold( }); return converged; } + +//===--===// +// One-Shot Dialect Conversion Infrastructure +//===-

[llvm-branch-commits] [mlir] [mlir] Revise IDE folder structure (PR #89749)

2024-05-21 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/89749 ___ 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][test] Reorganize the test dialect (PR #89424)

2024-04-22 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/89424 ___ 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][test] Reorganize the test dialect (PR #89424)

2024-04-22 Thread Mehdi Amini via llvm-branch-commits
joker-eph wrote: LG, but please make sure to remove all spurious headers from the commit description (seems like it should start at "This PR massively ...") https://github.com/llvm/llvm-project/pull/89424 ___ llvm-branch-commits mailing list llvm-bran

[llvm-branch-commits] [llvm] [mlir] [mlir][test] Shard and reorganize the test dialect (PR #89424)

2024-04-19 Thread Mehdi Amini via llvm-branch-commits
@@ -228,6 +332,7 @@ void TestDialect::initialize() { >(); registerOpsSyntax(); addOperations(); + registerTestDialectOperations(this); joker-eph wrote: This the actual "magic" right? You're calling into the generated registration method which dispa

[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-04-17 Thread Mehdi Amini via llvm-branch-commits
@@ -0,0 +1,44 @@ +//===- CIRDialect.td - CIR dialect -*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-04-17 Thread Mehdi Amini via llvm-branch-commits
@@ -0,0 +1,44 @@ +//===- CIRDialect.td - CIR dialect -*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

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

2024-04-08 Thread Mehdi Amini via llvm-branch-commits
joker-eph wrote: Can you provide a test that exercises this? Thanks! https://github.com/llvm/llvm-project/pull/87976 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-com

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Introduce the LoopWrapperInterface (PR #87232)

2024-04-02 Thread Mehdi Amini via llvm-branch-commits
@@ -69,6 +69,74 @@ def ReductionClauseInterface : OpInterface<"ReductionClauseInterface"> { ]; } +def LoopWrapperInterface : OpInterface<"LoopWrapperInterface"> { + let description = [{ +OpenMP operations that can wrap a single loop nest. When taking a wrapper +rol

[llvm-branch-commits] [mlir] release/18.x: [ODS][NFC] Cast range.size() to int32_t in accumulation (#85629) (PR #86677)

2024-03-26 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/86677 ___ 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] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-22 Thread Mehdi Amini via llvm-branch-commits
@@ -0,0 +1,46 @@ +//===- CIRTypes.td - CIR dialect types -*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-22 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph edited https://github.com/llvm/llvm-project/pull/86080 ___ 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] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-22 Thread Mehdi Amini via llvm-branch-commits
@@ -0,0 +1,46 @@ +//===- CIRTypes.td - CIR dialect types -*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-21 Thread Mehdi Amini via llvm-branch-commits
@@ -0,0 +1,16 @@ +# This replicates part of the add_mlir_dialect cmake function from MLIR that +# cannot be used here. This happens because it expects to be run inside MLIR +# directory which is not the case for CIR (and also FIR, both have similar +# workarounds). + +# Equivalent

[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-21 Thread Mehdi Amini via llvm-branch-commits
@@ -0,0 +1,46 @@ +//===- CIRTypes.td - CIR dialect types -*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-21 Thread Mehdi Amini via llvm-branch-commits
@@ -0,0 +1,18 @@ +//===-- CIROps.td - CIR dialect definition -*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-21 Thread Mehdi Amini via llvm-branch-commits
@@ -0,0 +1,16 @@ +# This replicates part of the add_mlir_dialect cmake function from MLIR that +# cannot be used here. This happens because it expects to be run inside MLIR +# directory which is not the case for CIR (and also FIR, both have similar +# workarounds). + +# Equivalent

[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

2024-03-21 Thread Mehdi Amini via llvm-branch-commits
@@ -0,0 +1,46 @@ +//===- CIRTypes.td - CIR dialect types -*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm-branch-commits] [mlir] [mlir][LLVM] erase call mappings in forgetMapping() (PR #84955)

2024-03-18 Thread Mehdi Amini via llvm-branch-commits
@@ -0,0 +1,47 @@ +// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s + +// Test that we don't crash when there is a call operation in the combiner + +omp.reduction.declare @add_f32 : f32 +init { +^bb0(%arg: f32): + %0 = llvm.mlir.constant(0.0 : f32) : f32 + omp.yield (%0 :

[llvm-branch-commits] [mlir] [mlir][LLVM] erase call mappings in forgetMapping() (PR #84955)

2024-03-15 Thread Mehdi Amini via llvm-branch-commits
@@ -0,0 +1,47 @@ +// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s + +// Test that we don't crash when there is a call operation in the combiner + +omp.reduction.declare @add_f32 : f32 +init { +^bb0(%arg: f32): + %0 = llvm.mlir.constant(0.0 : f32) : f32 + omp.yield (%0 :

[llvm-branch-commits] [mlir] release/18.x: [mlir][NFC] Apply rule of five to *Pass classes (#80998) (PR #83971)

2024-03-12 Thread Mehdi Amini via llvm-branch-commits
joker-eph wrote: Do we have any ABI stability guarantees for LLVM C++ APIs? I would think that a lot of back ports can break the C++ ABI of LLVM in general? (I was assuming we'd care about the LLVM C API, libclang, ...) https://github.com/llvm/llvm-project/pull/83971 ___

[llvm-branch-commits] [mlir] [mlir][LLVM] erase call mappings in forgetMapping() (PR #84955)

2024-03-12 Thread Mehdi Amini via llvm-branch-commits
joker-eph wrote: We need a test here https://github.com/llvm/llvm-project/pull/84955 ___ 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][NFC] Apply rule of five to *Pass classes (#80998) (PR #83971)

2024-03-12 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/83971 ___ 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] Support `replaceAllUsesWith` in dialect conversion (PR #84725)

2024-03-11 Thread Mehdi Amini 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: + /// Return

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

2024-03-11 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/84722 ___ 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 Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. 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 Mehdi Amini via llvm-branch-commits
@@ -572,20 +571,33 @@ bool GreedyPatternRewriteDriver::processWorklist() { logger.getOStream() << ")' {\n"; logger.indent(); }); + if (config.listener) +config.listener->notifyPatternBegin(pattern, op); return true; }; -auto on

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

2024-03-07 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph 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 Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph 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 Mehdi Amini via llvm-branch-commits
@@ -68,9 +68,9 @@ class PatternApplicator { ///invalidate the match and try another pattern. LogicalResult matchAndRewrite(Operation *op, PatternRewriter &rewriter, - 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 Mehdi Amini via llvm-branch-commits
@@ -68,9 +68,9 @@ class PatternApplicator { ///invalidate the match and try another pattern. LogicalResult matchAndRewrite(Operation *op, PatternRewriter &rewriter, - 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 Mehdi Amini via llvm-branch-commits
@@ -562,30 +562,39 @@ bool GreedyPatternRewriteDriver::processWorklist() { // Try to match one of the patterns. The rewriter is automatically // notified of any necessary changes, so there is nothing else to do // here. +std::function canApply = nullptr; +st

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

2024-03-07 Thread Mehdi Amini via llvm-branch-commits
@@ -562,30 +562,39 @@ bool GreedyPatternRewriteDriver::processWorklist() { // Try to match one of the patterns. The rewriter is automatically // notified of any necessary changes, so there is nothing else to do // here. +std::function canApply = nullptr; +st

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

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

[llvm-branch-commits] [clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] Rename llvm::ThreadPool -> llvm::DefaultThreadPool (NFC) (PR #83702)

2024-03-05 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph reopened https://github.com/llvm/llvm-project/pull/83702 ___ 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] [clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] Rename llvm::ThreadPool -> llvm::DefaultThreadPool (NFC) (PR #83702)

2024-03-05 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph closed https://github.com/llvm/llvm-project/pull/83702 ___ 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] [clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] Rename llvm::ThreadPool -> llvm::DefaultThreadPool (NFC) (PR #83702)

2024-03-05 Thread Mehdi Amini via llvm-branch-commits
joker-eph wrote: Here is the extracted one: https://github.com/llvm/llvm-project/pull/84056 And the diff here is now clean (stacked on top of #84056 ) How does it look now @dwblaikie ? https://github.com/llvm/llvm-project/pull/83702 ___ llvm-branch-

[llvm-branch-commits] [clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] Rename llvm::ThreadPool -> llvm::DefaultThreadPool (NFC) (PR #83702)

2024-03-05 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph updated https://github.com/llvm/llvm-project/pull/83702 >From 7935f2b8d298c7c882a472baf982cd29aa87cb26 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Tue, 5 Mar 2024 10:38:41 -0800 Subject: [PATCH] Rename llvm::ThreadPool -> llvm::DefaultThreadPool (NFC) The base

[llvm-branch-commits] [clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] Rename llvm::ThreadPool -> llvm::DefaultThreadPool (NFC) (PR #83702)

2024-03-05 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph edited https://github.com/llvm/llvm-project/pull/83702 ___ 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] Support rolling back properties in dialect conversion (PR #82474)

2024-02-21 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/82474 ___ 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] [flang] [mlir] [mlir][Transforms] Make `ConversionPatternRewriter` constructor private (PR #82244)

2024-02-21 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/82244 ___ 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] Support rolling back properties in dialect conversion (PR #82474)

2024-02-21 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph edited https://github.com/llvm/llvm-project/pull/82474 ___ 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] Support rolling back properties in dialect conversion (PR #82474)

2024-02-21 Thread Mehdi Amini 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()), -succ

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

2024-02-21 Thread Mehdi Amini via llvm-branch-commits
@@ -1016,13 +1035,20 @@ class ModifyOperationRewrite : public OperationRewrite { op->setOperands(operands); for (const auto &it : llvm::enumerate(successors)) op->setSuccessor(it.value(), it.index()); +if (propertiesStorage) { + OpaqueProperties prop(prop

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

2024-02-21 Thread Mehdi Amini 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()), -succ

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

2024-02-21 Thread Mehdi Amini 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()), -succ

[llvm-branch-commits] [mlir] [mlir][Transforms] Support `moveOpBefore`/`After` in dialect conversion (PR #81240)

2024-02-12 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/81240 ___ 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] Modularize block actions (PR #81237)

2024-02-12 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/81237 ___ 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 Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph 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][Transforms][NFC] Modularize block actions (PR #81237)

2024-02-09 Thread Mehdi Amini via llvm-branch-commits
@@ -820,6 +740,238 @@ void ArgConverter::insertConversion(Block *newBlock, conversionInfo.insert({newBlock, std::move(info)}); } +//===--===// +// RewriteAction joker-eph wrote: Mentioned i

[llvm-branch-commits] [mlir] [mlir][Transforms] Support `moveOpBefore`/`After` in dialect conversion (PR #81240)

2024-02-09 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph approved this pull request. https://github.com/llvm/llvm-project/pull/81240 ___ 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] Support `moveOpBefore`/`After` in dialect conversion (PR #81240)

2024-02-09 Thread Mehdi Amini via llvm-branch-commits
@@ -970,6 +971,54 @@ class BlockTypeConversionAction : public BlockAction { void rollback() override; }; + +/// An operation rewrite. joker-eph wrote: Can you expand on the role of the class, the context where it's used? The "Action" name for this whole se

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

2024-02-02 Thread Mehdi Amini 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 { +: TypeDefhttps://github.com/llvm/llvm-project/pull/80421

[llvm-branch-commits] [llvm] 6542aad - [𝘀𝗽𝗿] initial version

2023-11-03 Thread Mehdi Amini via llvm-branch-commits
Author: Florian Hahn Date: 2023-11-03T13:31:37-07:00 New Revision: 6542aad3fd2f8a158f6c2180b44c875144670dec URL: https://github.com/llvm/llvm-project/commit/6542aad3fd2f8a158f6c2180b44c875144670dec DIFF: https://github.com/llvm/llvm-project/commit/6542aad3fd2f8a158f6c2180b44c875144670dec.diff

[llvm-branch-commits] [clang] [clang-tools-extra] [llvm] [flang] [lldb] [mlir] [libcxx] [compiler-rt] [libcxxabi] [lld] Refactor ModuleToObject to offer more flexibility to subclass (NFC) (PR #71165)

2023-11-03 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph updated https://github.com/llvm/llvm-project/pull/71165 >From 183f5094ff7da09beed46f760a857af449a24245 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Fri, 3 Nov 2023 13:26:56 -0700 Subject: [PATCH] use cached TM Created using spr 1.3.4 --- mlir/lib/Target/LLVM/M

[llvm-branch-commits] [llvm] [clang] [mlir] Refactor ModuleToObject to offer more flexibility to subclass (NFC) (PR #71165)

2023-11-03 Thread Mehdi Amini via llvm-branch-commits
https://github.com/joker-eph updated https://github.com/llvm/llvm-project/pull/71165 >From 183f5094ff7da09beed46f760a857af449a24245 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Fri, 3 Nov 2023 13:26:56 -0700 Subject: [PATCH] use cached TM Created using spr 1.3.4 --- mlir/lib/Target/LLVM/M

[llvm-branch-commits] [mlir] 183f509 - use cached TM

2023-11-03 Thread Mehdi Amini via llvm-branch-commits
Author: Mehdi Amini Date: 2023-11-03T13:26:56-07:00 New Revision: 183f5094ff7da09beed46f760a857af449a24245 URL: https://github.com/llvm/llvm-project/commit/183f5094ff7da09beed46f760a857af449a24245 DIFF: https://github.com/llvm/llvm-project/commit/183f5094ff7da09beed46f760a857af449a24245.diff L

[llvm-branch-commits] [clang] [mlir] [llvm] Refactor ModuleToObject to offer more flexibility to subclass (NFC) (PR #71165)

2023-11-03 Thread Mehdi Amini via llvm-branch-commits
@@ -39,32 +39,32 @@ ModuleToObject::ModuleToObject(Operation &module, StringRef triple, : module(module), triple(triple), chip(chip), features(features), optLevel(optLevel) {} +ModuleToObject::~ModuleToObject() = default; + Operation &ModuleToObject::getOperation()

[llvm-branch-commits] [clang] b7e4dc7 - rebase

2023-11-03 Thread Mehdi Amini via llvm-branch-commits
Author: Mehdi Amini Date: 2023-11-03T03:23:50-07:00 New Revision: b7e4dc73442b986e8effe80afdd7bb409d0a367b URL: https://github.com/llvm/llvm-project/commit/b7e4dc73442b986e8effe80afdd7bb409d0a367b DIFF: https://github.com/llvm/llvm-project/commit/b7e4dc73442b986e8effe80afdd7bb409d0a367b.diff L

[llvm-branch-commits] [clang] 3289ecf - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-03 Thread Mehdi Amini via llvm-branch-commits
Author: Mehdi Amini Date: 2023-11-03T03:23:43-07:00 New Revision: 3289ecff8e8f5022cb6a40777392c98f1bcf5780 URL: https://github.com/llvm/llvm-project/commit/3289ecff8e8f5022cb6a40777392c98f1bcf5780 DIFF: https://github.com/llvm/llvm-project/commit/3289ecff8e8f5022cb6a40777392c98f1bcf5780.diff L

  1   2   >