# mlir

Published articles for mlir.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Integer Set Library (ISL) - A Primer

DevFeed: [Integer Set Library (ISL) - A Primer](<https://devfeed.tech/articles/integer-set-library-isl-a-primer-40491.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2025/10/19/isl-a-primer/>)

Published: 2025-10-19T20:14:22Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Library](<https://devfeed.tech/topics/library.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [compilers](<https://devfeed.tech/topics/compilers.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [mlir](<https://devfeed.tech/topics/mlir.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [isl](<https://devfeed.tech/tags/isl.md>), [library](<https://devfeed.tech/tags/library.md>), [loops](<https://devfeed.tech/tags/loops.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [polyhedral-optimization](<https://devfeed.tech/tags/polyhedral-optimization.md>), [programming](<https://devfeed.tech/tags/programming.md>), [set-theory](<https://devfeed.tech/tags/set-theory.md>)

### AI overview

This primer introduces the Integer Set Library (ISL), an open-source C library that implements core algorithms for polyhedral optimization. It focuses on representing integer sets and relations, manipulating them, and the relationship between ISL and MLIR's Fast Presburger Library.

### Source excerpt

Polyhedral optimization is a tool used in compilers for optimizing loop nests. While the major compilers that use this implement polyhedral optimizations from scratch,1 there is a generally-applicable open source C library called the Integer Set Library (ISL) that implements the core algorithms used in polyhedral optimization. This article gives an overview of a subset of ISL, mainly focusing on the representation of sets and relations and basic manipulations on them.

## MLIR -- Defining Patterns with PDLL

DevFeed: [MLIR -- Defining Patterns with PDLL](<https://devfeed.tech/articles/mlir-defining-patterns-with-pdll-40485.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2024/08/04/mlir-pdll/>)

Published: 2024-08-04T14:00:00Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [LLVM](<https://devfeed.tech/topics/llvm.md>), [Tooling](<https://devfeed.tech/topics/tooling.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [heir](<https://devfeed.tech/tags/heir.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [primer](<https://devfeed.tech/tags/primer.md>), [programming](<https://devfeed.tech/tags/programming.md>), [tablegen](<https://devfeed.tech/tags/tablegen.md>)

### AI overview

A tutorial on using PDLL to define MLIR patterns. It explains PDLL's relationship to PDL, its intended role as an alternative to TableGen pattern definitions, and how PDLL files are transformed into IR and then C++ code for compilation into a pass.

### Source excerpt

Table of Contents In this article I'll show how to use PDLL, a tool for defining MLIR patterns, which itself is built with MLIR. PDLL is intended to be a replacement for defining patterns in tablegen, though there are few public examples of its use. In fact, the main impetus for PDLL is that tablegen makes it difficult to express things like: Operations that return multiple results Operations with regions Operations with variadic operands Arithmetic on static values While not all these features are fully supported in PDLL yet, they are within scope of the language and tooling.

## Polynomial dialect and mlir-opt tutorial upstreamed

DevFeed: [Polynomial dialect and mlir-opt tutorial upstreamed](<https://devfeed.tech/articles/polynomial-dialect-and-mlir-opt-tutorial-upstreamed-40507.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/shortform/2024-08-02-1551/>)

Published: 2024-08-02T22:51:23Z

Content type: article

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [mlir](<https://devfeed.tech/topics/mlir.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [debug](<https://devfeed.tech/topics/debug.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [math](<https://devfeed.tech/topics/math.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [math](<https://devfeed.tech/tags/math.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [shortform](<https://devfeed.tech/tags/shortform.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

The author describes upstreaming compiler work to MLIR, including a tutorial on mlir-opt for debugging MLIR pass pipelines and the beginning of a polynomial math dialect. They also discuss planned polynomial approximation passes that would track approximation error in the IR.

### Source excerpt

I've been upstreaming a bit of my compiler work to the MLIR project. Yesterday, I merged in a tutorial on mlir-opt, the main debugging tool for running passes on MLIR code. This is roughly the upstreamable parts of my first MLIR tutorial entry, MLIR -- Running and Testing a Lowering. Mehdi Amini also provided a lot of useful information during review that taught me some stuff I didn't know about the tool.

## MLIR -- A Global Optimization and Dataflow Analysis

DevFeed: [MLIR -- A Global Optimization and Dataflow Analysis](<https://devfeed.tech/articles/mlir-a-global-optimization-and-dataflow-analysis-40481.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/11/15/mlir-a-global-optimization-and-dataflow-analysis/>)

Published: 2023-11-15T11:20:52Z

Content type: article

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Optimization](<https://devfeed.tech/topics/optimization.md>), [Code](<https://devfeed.tech/topics/code.md>), [Framework](<https://devfeed.tech/topics/framework.md>)

Tags: [analysis](<https://devfeed.tech/tags/analysis.md>), [code](<https://devfeed.tech/tags/code.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [framework](<https://devfeed.tech/tags/framework.md>), [heir](<https://devfeed.tech/tags/heir.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [primer](<https://devfeed.tech/tags/primer.md>), [programming](<https://devfeed.tech/tags/programming.md>), [pull-request](<https://devfeed.tech/tags/pull-request.md>)

### AI overview

This article explains how to implement a global optimization pass in MLIR for noisy integer arithmetic. It uses a dataflow analysis framework to verify the optimization and aims to keep noise within legal limits while minimizing program cost.

### Source excerpt

Table of Contents In this article we'll implement a global optimization pass, and show how to use the dataflow analysis framework to verify the results of our optimization. The code for this article is in this pull request, and as usual the commits are organized to be read in order. The noisy arithmetic problem This demonstration is based on a simplified model of computation relevant to the HEIR project. You don't need to be familiar with that project to follow this article, but if you're wondering why someone would ever want the kind of optimization I'm going to write, that project is why.

## MLIR -- Lowering through LLVM

DevFeed: [MLIR -- Lowering through LLVM](<https://devfeed.tech/articles/mlir-lowering-through-llvm-40480.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/11/01/mlir-lowering-through-llvm/>)

Published: 2023-11-01T07:00:00Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [mlir](<https://devfeed.tech/topics/mlir.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [x86](<https://devfeed.tech/topics/x86.md>)

Tags: [compilers](<https://devfeed.tech/tags/compilers.md>), [heir](<https://devfeed.tech/tags/heir.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [pipeline](<https://devfeed.tech/tags/pipeline.md>), [primer](<https://devfeed.tech/tags/primer.md>), [programming](<https://devfeed.tech/tags/programming.md>), [x86](<https://devfeed.tech/tags/x86.md>)

### AI overview

A tutorial on lowering a custom MLIR poly dialect through the LLVM dialect, exporting LLVM IR, and compiling it to x86 machine code. It explains how to construct and incrementally develop MLIR lowering pipelines.

### Source excerpt

Table of Contents In the last article we lowered our custom poly dialect to standard MLIR dialects. In this article we'll continue lowering it to LLVM IR, exporting it out of MLIR to LLVM, and then compiling to x86 machine code. The code for this article is in this pull request, and as usual the commits are organized to be read in order. Defining a Pipeline The first step in lowering to machine code is to lower to an "exit dialect.

## MLIR -- Dialect Conversion

DevFeed: [MLIR -- Dialect Conversion](<https://devfeed.tech/articles/mlir-dialect-conversion-40479.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/10/23/mlir-dialect-conversion/>)

Published: 2023-10-23T06:00:00Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Tutorial](<https://devfeed.tech/topics/tutorial.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [code](<https://devfeed.tech/tags/code.md>), [heir](<https://devfeed.tech/tags/heir.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [polynomial-ring](<https://devfeed.tech/tags/polynomial-ring.md>), [polynomials](<https://devfeed.tech/tags/polynomials.md>), [primer](<https://devfeed.tech/tags/primer.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

This tutorial introduces MLIR dialect conversion and incremental lowering, explaining how a custom dialect can be lowered to standard MLIR dialects. It focuses on the type obstacle: changing value types can temporarily invalidate downstream users, requiring special handling during conversion.

### Source excerpt

Table of Contents In previous articles we defined a dialect, and wrote various passes to optimize and canonicalize a program using that dialect. However, one of the main tenets of MLIR is "incremental lowering," the idea that there are lots of levels of IR granularity, and you incrementally lower different parts of the IR, only discarding information when it's no longer useful for optimizations. In this article we'll see the first step of that: lowering the poly dialect to a combination of standard MLIR dialects, using the so-called dialect conversion infrastructure to accomplish it.

## MLIR -- Canonicalizers and Declarative Rewrite Patterns

DevFeed: [MLIR -- Canonicalizers and Declarative Rewrite Patterns](<https://devfeed.tech/articles/mlir-canonicalizers-and-declarative-rewrite-patterns-40477.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/09/20/mlir-canonicalizers-and-declarative-rewrite-patterns/>)

Published: 2023-09-20T08:00:00Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [canonicalization](<https://devfeed.tech/tags/canonicalization.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [complex-numbers](<https://devfeed.tech/tags/complex-numbers.md>), [declarative](<https://devfeed.tech/tags/declarative.md>), [deprecated](<https://devfeed.tech/tags/deprecated.md>), [maintenance](<https://devfeed.tech/tags/maintenance.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [polynomials](<https://devfeed.tech/tags/polynomials.md>), [primer](<https://devfeed.tech/tags/primer.md>), [programming](<https://devfeed.tech/tags/programming.md>), [rewrite](<https://devfeed.tech/tags/rewrite.md>), [tablegen](<https://devfeed.tech/tags/tablegen.md>), [test](<https://devfeed.tech/tags/test.md>)

### AI overview

This tutorial explains how to implement general canonicalization patterns in MLIR. It covers both C++ canonicalizers and declarative rewrite rules in TableGen, including an identity-based polynomial rewrite and its testing considerations.

### Source excerpt

Table of Contents In a previous article we defined folding functions, and used them to enable some canonicalization and the sccp constant propagation pass for the poly dialect. This time we'll see how to add more general canonicalization patterns. The code for this article is in this pull request, and as usual the commits are organized to be read in order. Why is Canonicalization Needed? MLIR provides folding as a mechanism to simplify an IR, which can result in simpler, more efficient ops (e.

## MLIR -- Verifiers

DevFeed: [MLIR -- Verifiers](<https://devfeed.tech/articles/mlir-verifiers-40475.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/09/13/mlir-verifiers/>)

Published: 2023-09-13T09:00:00Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [mlir](<https://devfeed.tech/topics/mlir.md>), [Code](<https://devfeed.tech/topics/code.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [canonicalization](<https://devfeed.tech/tags/canonicalization.md>), [code](<https://devfeed.tech/tags/code.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [operations](<https://devfeed.tech/tags/operations.md>), [pass](<https://devfeed.tech/tags/pass.md>), [primer](<https://devfeed.tech/tags/primer.md>), [programming](<https://devfeed.tech/tags/programming.md>), [pull-request](<https://devfeed.tech/tags/pull-request.md>), [safety](<https://devfeed.tech/tags/safety.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

This tutorial explains how to add verifiers to an MLIR dialect. Verifiers check that types and operations are well-formed before and after passes, enforcing operation invariants and allowing passes to avoid repeated edge-case checks. It also describes trait-based verification, generated type-checking and inference support, assembly-format simplification, builders, and related test updates.

### Source excerpt

Table of Contents Last time we defined folders and used them to enable some canonicalization and the sccp constant propagation pass for the poly dialect. This time we'll add some additional safety checks to the dialect in the form of verifiers. The code for this article is in this pull request, and as usual the commits are organized to be read in order. Purpose of a verifier Verifiers ensure the types and operations in a concrete MLIR program are well-formed.

## MLIR -- Folders and Constant Propagation

DevFeed: [MLIR -- Folders and Constant Propagation](<https://devfeed.tech/articles/mlir-folders-and-constant-propagation-40474.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/09/11/mlir-folders/>)

Published: 2023-09-11T08:00:00Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [Computing](<https://devfeed.tech/topics/computing.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [canonicalization](<https://devfeed.tech/tags/canonicalization.md>), [code](<https://devfeed.tech/tags/code.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [folding](<https://devfeed.tech/tags/folding.md>), [heir](<https://devfeed.tech/tags/heir.md>), [invariant](<https://devfeed.tech/tags/invariant.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [process](<https://devfeed.tech/tags/process.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

This tutorial explains how MLIR folding supports sparse conditional constant propagation and canonicalization. It describes adding a constant operation, a materialization hook, and folders for each operation, while distinguishing local canonicalization from propagation through control flow.

### Source excerpt

Table of Contents Last time we saw how to use pre-defined MLIR traits to enable upstream MLIR passes like loop-invariant-code-motion to apply to poly programs. We left out -sccp (sparse conditional constant propagation), and so this time we'll add what is needed to make that pass work. It requires the concept of folding. The code for this article is in this pull request, and as usual the commits are organized to be read in order.

## MLIR -- Using Traits

DevFeed: [MLIR -- Using Traits](<https://devfeed.tech/articles/mlir-using-traits-40473.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/09/07/mlir-using-traits/>)

Published: 2023-09-07T08:00:00Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Compiler](<https://devfeed.tech/topics/compiler.md>), [toolchain](<https://devfeed.tech/topics/toolchain.md>), [optimize](<https://devfeed.tech/topics/optimize.md>), [Code](<https://devfeed.tech/topics/code.md>), [interface](<https://devfeed.tech/topics/interface.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [heir](<https://devfeed.tech/tags/heir.md>), [interface](<https://devfeed.tech/tags/interface.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [optimize](<https://devfeed.tech/tags/optimize.md>), [programming](<https://devfeed.tech/tags/programming.md>), [toolchain](<https://devfeed.tech/tags/toolchain.md>)

### AI overview

This tutorial explains how to add predefined MLIR traits to operations in a polynomial-arithmetic dialect. It shows how traits and interfaces enable reuse of existing compiler passes, including loop-invariant code motion, and support operation verification and type inference.

### Source excerpt

Table of Contents Last time we defined a new dialect poly for polynomial arithmetic. This time we'll spruce up the dialect by adding some pre-defined MLIR traits, and see how the application of traits enables some general purpose passes to optimize poly programs. The code for this article is in this pull request, and as usual the commits are organized to be read in order. Traits and Loop Invariant Code Motion As a compiler toolchain, MLIR heavily emphasizes code reuse.

## MLIR -- Defining a New Dialect

DevFeed: [MLIR -- Defining a New Dialect](<https://devfeed.tech/articles/mlir-defining-a-new-dialect-40471.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/08/21/mlir-defining-a-new-dialect/>)

Published: 2023-08-21T08:00:00Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Code generation](<https://devfeed.tech/topics/code-generation.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [polynomials](<https://devfeed.tech/topics/polynomials.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [define](<https://devfeed.tech/tags/define.md>), [endif](<https://devfeed.tech/tags/endif.md>), [ifdef](<https://devfeed.tech/tags/ifdef.md>), [include](<https://devfeed.tech/tags/include.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [polynomials](<https://devfeed.tech/tags/polynomials.md>), [programming](<https://devfeed.tech/tags/programming.md>), [tablegen](<https://devfeed.tech/tags/tablegen.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [undef](<https://devfeed.tech/tags/undef.md>)

### AI overview

This tutorial explains how to define a new MLIR dialect for arithmetic on single-variable polynomials with 32-bit unsigned integer coefficients. It covers the design, an empty dialect, generated code, registration, and a simple custom type.

### Source excerpt

Table of Contents In the last article in the series, we migrated the passes we had written to use the tablegen code generation framework. That was a preface to using tablegen to define dialects. In this article we'll define a dialect that represents arithmetic on single-variable polynomials, with coefficients in $\mathbb{Z} / 2^{32} \mathbb{Z}$ (32-bit unsigned integers). The code for this article is in this pull request, and as usual the commits are organized to be read in order.

## MLIR -- Using Tablegen for Passes

DevFeed: [MLIR -- Using Tablegen for Passes](<https://devfeed.tech/articles/mlir-using-tablegen-for-passes-40469.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/08/10/mlir-using-tablegen-for-passes/>)

Published: 2023-08-10T14:41:45Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Code generation](<https://devfeed.tech/topics/code-generation.md>), [Code](<https://devfeed.tech/topics/code.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>)

Tags: [boilerplate](<https://devfeed.tech/tags/boilerplate.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [define](<https://devfeed.tech/tags/define.md>), [endif](<https://devfeed.tech/tags/endif.md>), [fhe](<https://devfeed.tech/tags/fhe.md>), [ifdef](<https://devfeed.tech/tags/ifdef.md>), [include](<https://devfeed.tech/tags/include.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [programming](<https://devfeed.tech/tags/programming.md>), [tablegen](<https://devfeed.tech/tags/tablegen.md>), [undef](<https://devfeed.tech/tags/undef.md>)

### AI overview

This article explains how MLIR developers can use TableGen to define passes and generate boilerplate code, headers, documentation, and registration hooks. It also discusses the need to understand the generated C++ code and the tool's limited diagnostic information.

### Source excerpt

Table of Contents In the last article in this series, we defined some custom lowering passes that modified an MLIR program. Notably, we accomplished that by implementing the required interfaces of the MLIR API directly. This is not the way that most MLIR developers work. Instead, they use a code generation tool called tablegen to generate boilerplate for them, and then only add the implementation methods that are custom to their work.

## MLIR -- Writing Our First Pass

DevFeed: [MLIR -- Writing Our First Pass](<https://devfeed.tech/articles/mlir-writing-our-first-pass-40470.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/08/10/mlir-writing-our-first-pass/>)

Published: 2023-08-10T14:39:42Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [mlir](<https://devfeed.tech/topics/mlir.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [API](<https://devfeed.tech/topics/api.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [canonicalization](<https://devfeed.tech/tags/canonicalization.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [optimize](<https://devfeed.tech/tags/optimize.md>), [programming](<https://devfeed.tech/tags/programming.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

This tutorial introduces MLIR pass development through the HEIR project. It explains how to create a custom tool for an out-of-tree MLIR project and implement simple passes, including loop unrolling and instruction replacement, using the MLIR API and pass infrastructure.

### Source excerpt

Table of Contents This series is an introduction to MLIR and an onboarding tutorial for the HEIR project. Last time we saw how to run and test a basic lowering. This time we will write some simple passes to illustrate the various parts of the MLIR API and the pass infrastructure. As mentioned previously, the main work in MLIR is defining passes that either optimize part of a program, lower from parts of one dialect to others, or perform various normalization and canonicalization operations.

## MLIR -- Running and Testing a Lowering

DevFeed: [MLIR -- Running and Testing a Lowering](<https://devfeed.tech/articles/mlir-running-and-testing-a-lowering-40468.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/08/10/mlir-running-and-testing-a-lowering/>)

Published: 2023-08-10T14:36:13Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Compiler](<https://devfeed.tech/topics/compiler.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [bazel](<https://devfeed.tech/topics/bazel.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>)

Tags: [bazel](<https://devfeed.tech/tags/bazel.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [fhe](<https://devfeed.tech/tags/fhe.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [programming](<https://devfeed.tech/tags/programming.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tiling](<https://devfeed.tech/tags/tiling.md>)

### AI overview

This tutorial introduces MLIR dialects and lowerings, explains how MLIR incrementally transforms programs through intermediate representations, and demonstrates end-to-end testing for a simple lowering.

### Source excerpt

Table of Contents Last time, we covered a Bazel build system setup for an MLIR project. This time we'll give an overview of a simple lowering and show how end-to-end tests work in MLIR. All of the code for this article is contained in this pull request on GitHub, and the commits are nicely organized and quite readable. Two of the central concepts in MLIR are dialects and lowerings. These are the scaffolding within which we can do the truly interesting parts of a compiler--that is, the optimizations and analyses.

## MLIR -- Getting Started

DevFeed: [MLIR -- Getting Started](<https://devfeed.tech/articles/mlir-getting-started-40467.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/08/10/mlir-getting-started/>)

Published: 2023-08-10T14:32:33Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [mlir](<https://devfeed.tech/topics/mlir.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [toolchain](<https://devfeed.tech/topics/toolchain.md>), [FHE](<https://devfeed.tech/topics/fhe.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [Google](<https://devfeed.tech/topics/google.md>), [monorepo](<https://devfeed.tech/topics/monorepo.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [build-system](<https://devfeed.tech/tags/build-system.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [encryption](<https://devfeed.tech/tags/encryption.md>), [fhe](<https://devfeed.tech/tags/fhe.md>), [github-repository](<https://devfeed.tech/tags/github-repository.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [monorepo](<https://devfeed.tech/tags/monorepo.md>), [programming](<https://devfeed.tech/tags/programming.md>), [toolchain](<https://devfeed.tech/tags/toolchain.md>)

### AI overview

This introductory article explains the structure of a typical MLIR project and the build system used in the HEIR project, a Google effort focused on production engineering tools for Fully Homomorphic Encryption. It also introduces the relationship between MLIR and LLVM and describes pinning the MLIR dependency to a specific commit hash.

### Source excerpt

Table of Contents As we announced recently, my team at Google has started a new effort to build production-worthy engineering tools for Fully Homomorphic Encryption (FHE). One focal point of this, and one which I'll be focusing on as long as Google is willing to pay me to do so, is building out a compiler toolchain for FHE in the MLIR framework (Multi-Level Intermediate Representation). The project is called Homomorphic Encryption Intermediate Representation, or HEIR.

## Google's Recent FHE work, and starting HEIR

DevFeed: [Google's Recent FHE work, and starting HEIR](<https://devfeed.tech/articles/google-s-recent-fhe-work-and-starting-heir-40466.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2023/08/10/googles-recent-fhe-work-and-starting-heir/>)

Published: 2023-08-10T12:22:29Z

Content type: article

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [FHE](<https://devfeed.tech/topics/fhe.md>), [homomorphic encryption](<https://devfeed.tech/topics/homomorphic-encryption.md>), [Google](<https://devfeed.tech/topics/google.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Machine learning](<https://devfeed.tech/topics/machine-learning.md>)

Tags: [compiler](<https://devfeed.tech/tags/compiler.md>), [encryption](<https://devfeed.tech/tags/encryption.md>), [fhe](<https://devfeed.tech/tags/fhe.md>), [github](<https://devfeed.tech/tags/github.md>), [github-repository](<https://devfeed.tech/tags/github-repository.md>), [google](<https://devfeed.tech/tags/google.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [homomorphic-encryption](<https://devfeed.tech/tags/homomorphic-encryption.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [models](<https://devfeed.tech/tags/models.md>), [repository](<https://devfeed.tech/tags/repository.md>)

### AI overview

A Google team reports recent work on fully homomorphic encryption, including video processing, machine-learning model compilation, TPU implementation, and compiler improvements. The article also introduces HEIR, an early project intended to provide a standardized foundation for FHE compilers using MLIR.

### Source excerpt

Today my team at Google published an article on Google's Developers Blog with some updates on what we've been doing with fully homomorphic encryption (FHE). There's fun stuff in there, including work on video processing FHE, compiling ML models to FHE, an FHE implementation for TPUs, and improvements to the compiler I wrote about earlier this year. TODO: add mower gif video A simple object movement tracking algorithm in FHE, tracking a runaway lawn mower from a Nest camera.