패스 단위 최적화를 넘어: 대형 언어 모델을 활용한 의도 주도형 IR 최적화
Beyond Pass-by-Pass Optimization: Intent-Driven IR Optimization with Large Language Models
현대의 컴파일러는 중간 표현(IR)에 대한 일련의 모듈식 패스를 통해 프로그램을 최적화한다. 이러한 패스 단위 패러다임은 공학적 이점을 제공하지만, 패스 조정 문제(pass coordination problem)를 겪는다. 즉, 국소적으로 유익한 변환이 이후 단계에서 더 큰 이점을 줄 수 있는 최적화를 방해할 수 있다. 이러한 한계는 전역적 성능 목표를 달성하기 위해 여러 변환을 조정하는 종합적 전략인 '최적화 의도(optimization intent)'에 대한 명시적 개념의 부재에서 기인한다. 최근의 LLM 기반 접근법은 IR 최적화를 종단 간(end-to-end) 생성 작업으로 공식화하여 전통적인 패스 단위 구조를 회피한다. 그러나 이러한 방법에서 최적화 의도는 여전히 암시적인 상태로 남아 있어, 모델이 최적화 전략 추론과 저수준 변환 생성을 동시에 수행하도록 강제하며, 이는 결과적으로 정확성과 성능 모두를 제한한다. 본 논문에서는 고수준의 최적화 의도를 저수준 분석 및 변환과 명시적으로 분리하는 최초의 의도 주도형 IR 최적화기인 IntOpt를 제안한다. IntOpt는 IR 최적화를 의도 형성(intent formulation), 의도 정제(intent refinement), 의도 실현(intent realization)의 세 단계로 구성하여 전역적으로 조정된 변환을 가능하게 한다. 실험 결과, IntOpt는 200개의 프로그램 테스트 세트에서 90.5%의 검증된 정확성과 평균 2.660배의 속도 향상을 달성하여 최신 LLM 기반 최적화기들의 정확성과 성능을 모두 능가했다. 또한 37개의 벤치마크에서는 -O3 옵션을 적용한 최신 컴파일러를 뛰어넘어 최대 272.60배의 속도 향상을 보여주었다.
Modern compilers optimize programs through a sequence of modular passes over intermediate representations (IR). While this pass-by-pass paradigm offers engineering benefits, it suffers from a pass coordination problem: locally beneficial transformations may block more profitable optimizations in later stages. This limitation stems from the lack of an explicit notion of optimization intent, defined as a holistic strategy for coordinating multiple transformations toward a global performance objective. Recent LLM-based approaches formulate IR optimization as an end-to-end generation task, thereby avoiding the traditional pass-by-pass structure. However, optimization intent remains implicit in these methods, forcing models to jointly infer optimization strategy and generate low-level transformations, which limits both correctness and performance. We propose IntOpt, the first intent-driven IR optimizer that explicitly separates high-level optimization intent from low-level analysis and transformation. IntOpt organizes IR optimization into three stages: intent formulation, intent refinement, and intent realization, enabling globally coordinated transformations. Experiments show that IntOpt achieves 90.5% verified correctness and 2.660x average speedup on 200-program test set, outperforming state-of-the-art LLM-based optimizers in both correctness and performance, and surpassing modern compiler with the -O3 option on 37 benchmarks with speedups of up to 272.60x.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.