Towards Optimized Arithmetic Circuits with MLIR

Authors

  • Louis Ledoux INSA Lyon / Inria
  • Pierre Cochard INSA Lyon / Inria
  • Florent de Dinechin INSA Lyon / Inria

DOI:

https://doi.org/10.64552/wipiec.v11i1.90

Keywords:

MLIR, arithmetic optimization, fixed-point, polynomial approximation, high-level synthesis

Abstract

"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

2025-09-02

How to Cite

Ledoux, L., Cochard, P., & de Dinechin, F. (2025). Towards Optimized Arithmetic Circuits with MLIR. WiPiEC Journal - Works in Progress in Embedded Computing Journal, 11(1), 4. https://doi.org/10.64552/wipiec.v11i1.90