pith. sign in

arxiv: 2503.19449 · v3 · pith:FFUVTZ2Pnew · submitted 2025-03-25 · 💻 cs.SE · cs.AI· cs.LG· cs.PF

VecTrans: Enhancing Compiler Auto-Vectorization through LLM-Assisted Code Transformations

classification 💻 cs.SE cs.AIcs.LGcs.PF
keywords vectranscompilercodeauto-vectorizationllmspatternsvectorizationapproaches
0
0 comments X
read the original abstract

Auto-vectorization is a fundamental optimization for modern compilers to exploit SIMD parallelism. However, state-of-the-art approaches still struggle to handle intricate code patterns, often requiring manual hints or domain-specific expertise. Large language models (LLMs), with their ability to capture intricate patterns, provide a promising solution, yet their effective application in compiler optimizations remains an open challenge due to issues such as hallucinations and a lack of domain-specific reasoning. In this paper, we present VecTrans, a novel framework that leverages LLMs to enhance compiler-based code vectorization. VecTrans first employs compiler analysis to identify potentially vectorizable code regions. It then utilizes an LLM to refactor these regions into patterns that are more amenable to the compilers auto-vectorization. To ensure semantic correctness, VecTrans further integrates a hybrid validation mechanism at the intermediate representation (IR) level. With the above efforts, VecTrans combines the adaptability of LLMs with the precision of compiler vectorization, thereby effectively opening up the vectorization opportunities. experimental results show that among all TSVC functions unvectorizable by GCC, ICC, Clang, and BiSheng Compiler, VecTrans achieves an geomean speedup of 1.77x and successfully vectorizes 24 of 51 test cases. This marks a significant advancement over state-of-the-art approaches while maintaining a cost efficiency of $0.012 per function optimization for LLM API usage.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 3 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. AI Coding Agents Need Better Compiler Remarks

    cs.PL 2026-04 unverdicted novelty 7.0

    Replacing ambiguous compiler remarks with precise structured ones raises AI agent optimization success by 3.3x on TSVC by cutting semantic hallucinations, proving the bottleneck is the interface not the model size.

  2. AutoPass: Evidence-Guided LLM Agents for Compiler Performance Tuning

    cs.SE 2026-06 unverdicted novelty 6.0

    AutoPass uses evidence from compiler states and runtime feedback to guide LLM agents in tuning LLVM optimizations, delivering 1.043x and 1.117x geometric-mean speedups over -O3 on x86-64 and ARM64.

  3. AutoVecCoder: Teaching LLMs to Generate Explicitly Vectorized Code

    cs.CL 2026-05 unverdicted novelty 6.0

    AutoVecCoder combines VecPrompt for automated intrinsic knowledge synthesis and VecRL for efficiency-aligned RL to train an 8B LLM that achieves SOTA on SimdBench SSE/AVX subsets and sometimes exceeds -O3 compiler results.