Saved in:
Bibliographic Details
Main Authors: Yin, Jiaqi, Song, Zhan, Agostini, Nicolas Bohm, Tumeo, Antonino, Yu, Cunxi
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2506.02290
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915330233729024
author Yin, Jiaqi
Song, Zhan
Agostini, Nicolas Bohm
Tumeo, Antonino
Yu, Cunxi
author_facet Yin, Jiaqi
Song, Zhan
Agostini, Nicolas Bohm
Tumeo, Antonino
Yu, Cunxi
contents In modern computing systems, compilation employs numerous optimization techniques to enhance code performance. Source-to-source code transformations, which include control flow and datapath transformations, have been widely used in High-Level Synthesis (HLS) and compiler optimization. While researchers actively investigate methods to improve performance with source-to-source code transformations, they often overlook the significance of verifying their correctness. Current tools cannot provide a holistic verification of these transformations. This paper introduces HEC, a framework for equivalence checking that leverages the e-graph data structure to comprehensively verify functional equivalence between programs. HEC utilizes the MLIR as its frontend and integrates MLIR into the e-graph framework. Through the combination of dynamic and static e-graph rewriting, HEC facilitates the validation of comprehensive code transformations. We demonstrate effectiveness of HEC on PolyBenchC benchmarks, successfully verifying loop unrolling, tiling, and fusion transformations. HEC processes over 100,000 lines of MLIR code in 40 minutes with predictable runtime scaling. Importantly, HEC identified two critical compilation errors in mlir-opt: loop boundary check errors causing unintended executions during unrolling, and memory read-after-write violations in loop fusion that alter program semantics. These findings demonstrate HEC practical value in detecting real-world compiler bugs and highlight the importance of formal verification in optimization pipelines.
format Preprint
id arxiv_https___arxiv_org_abs_2506_02290
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle HEC: Equivalence Verification Checking for Code Transformation via Equality Saturation
Yin, Jiaqi
Song, Zhan
Agostini, Nicolas Bohm
Tumeo, Antonino
Yu, Cunxi
Hardware Architecture
Programming Languages
In modern computing systems, compilation employs numerous optimization techniques to enhance code performance. Source-to-source code transformations, which include control flow and datapath transformations, have been widely used in High-Level Synthesis (HLS) and compiler optimization. While researchers actively investigate methods to improve performance with source-to-source code transformations, they often overlook the significance of verifying their correctness. Current tools cannot provide a holistic verification of these transformations. This paper introduces HEC, a framework for equivalence checking that leverages the e-graph data structure to comprehensively verify functional equivalence between programs. HEC utilizes the MLIR as its frontend and integrates MLIR into the e-graph framework. Through the combination of dynamic and static e-graph rewriting, HEC facilitates the validation of comprehensive code transformations. We demonstrate effectiveness of HEC on PolyBenchC benchmarks, successfully verifying loop unrolling, tiling, and fusion transformations. HEC processes over 100,000 lines of MLIR code in 40 minutes with predictable runtime scaling. Importantly, HEC identified two critical compilation errors in mlir-opt: loop boundary check errors causing unintended executions during unrolling, and memory read-after-write violations in loop fusion that alter program semantics. These findings demonstrate HEC practical value in detecting real-world compiler bugs and highlight the importance of formal verification in optimization pipelines.
title HEC: Equivalence Verification Checking for Code Transformation via Equality Saturation
topic Hardware Architecture
Programming Languages
url https://arxiv.org/abs/2506.02290