Enabling RISC-V Vector Code Generation in MLIR through Custom xDSL Lowerings
Jie Lei, H\'ector Mart\'inez, Adri\'an Castell\'o

TL;DR
This paper introduces a compilation method combining MLIR and xDSL to generate optimized RISC-V Vector code, enabling portable high-performance kernels for scientific and machine learning workloads.
Contribution
It presents a novel approach using custom xDSL lowering passes to translate high-level operations into RISC-V Vector intrinsics, improving code portability and performance.
Findings
Generated kernels outperform OpenBLAS in GFLOPS.
Achieved up to 12.2 GFLOPS on RISC-V platforms.
Performance improvements of 10-35% on evaluated workloads.
Abstract
The growing adoption of RISC-V in high-performance and scientific computing has increased the need for performance-portable code targeting the RISC-V Vector (RVV) extension. However, current compiler infrastructures provide limited end-to-end support for generating optimized RVV code from high-level representations to low-level implementations. In particular, existing MLIR distributions lack practical lowering paths that map high-level abstractions to RVV intrinsics, limiting their applicability for production-ready RISC-V kernels. This paper presents a compilation approach that combines MLIR with xDSL to bridge the missing lowering stages required for RVV code generation. Using custom intermediate representations and transformation passes implemented in xDSL, we systematically translate high-level operations into specialized, hardware-aware C code invoking RVV intrinsics. The resulting…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Numerical Methods and Algorithms · Embedded Systems Design Techniques
