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