Towards Optimized Arithmetic Circuits with MLIR
DOI:
https://doi.org/10.64552/wipiec.v11i1.90Keywords:
MLIR, arithmetic optimization, fixed-point, polynomial approximation, high-level synthesisAbstract
"Numerical programs are typically conceived using real numbers.
However, programming languages and compiler infrastructures operate at a lower abstraction level, constrained by fixed-width machine arithmetic.
This abstraction gap limits the scope of legal arithmetic optimizations and complicates the generation of efficient circuits for application-specific hardware.
This work introduces a set of MLIR dialects that explicitly separate concerns between real-valued computation and low-level arithmetic representation.
The RealArith dialect captures mathematical intent, enabling algebraic rewrites and approximation-aware transformations, while the FixedPointArith dialect expresses quantized arithmetic with fine-grained control over bit widths.
We implement an end-to-end lowering flow that performs polynomial approximation, generating fixed-point Horner-form architectures tailored for hardware synthesis.
This separation enables arithmetic optimizations beyond those supported by conventional compilers.
We present early hardware results on signal processing benchmarks, demonstrating the potential of our approach for arithmetic-aware circuit generation.
Our evaluation includes multiple polynomial approximation schemes, including single and uniform piecewise forms, which highlight trade-offs between arithmetic complexity and memory usage, and compares against Vitis HLS and standard MLIR lowering baselines."
References
S. Chevillard, M. Jolde¸s, and C. Lauter, “Sollya: An environment for the development of numerical codes,” in International Congress on Mathematical Software, vol. 6327. Heidelberg, Germany: Springer, September 2010, pp. 28–31. DOI: https://doi.org/10.1007/978-3-642-15582-6_5
F. de Dinechin and M. Kumm, Application-Specific Arithmetic. Springer, 2024. DOI: https://doi.org/10.1007/978-3-031-42808-1
C. Lattner et al., “MLIR: Scaling compiler infrastructure for domain specific computation,” in 2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO), 2021, pp. 2–14. DOI: https://doi.org/10.1109/CGO51591.2021.9370308
J.-M. Muller, Elementary functions, algorithms and implementation, 3rd Edition. Birkhaüser Boston, 2016.
Y. Orlarey, D. Fober, and S. Letz, “FAUST : an Efficient Functional Approach to DSP Programming,” in NEW COMPUTATIONAL PARADIGMS FOR COMPUTER MUSIC, E. D. FRANCE, Ed., 2009, pp. 65–96.
M. Popoff, “Audio DSP to FPGA Compilation: The Syfala Toolchain Approach,” Ph.D. dissertation, Univ Lyon, INSA Lyon, Inria, May 2023.

Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 Louis Ledoux, Pierre Cochard, Florent de Dinechin

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
License Terms:
Except where otherwise noted, content on this website is lincesed under a Creative Commons Attribution Non-Commercial License (CC BY NC)
Use, distribution and reproduction in any medium, provided the original work is properly cited and is not used for commercial purposes, is permitted.
Copyright to any article published by WiPiEC retained by the author(s). Authors grant WiPiEC Journal a license to publish the article and identify itself as the original publisher. Authors also grant any third party the right to use the article freely as long as it is not used for commercial purposes and its original authors, citation details, and publisher are identified, in accordance with CC BY NC license. Fore more information on license terms, click here.