# 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.