[논문 리뷰] Idempotent Slices with Applications to Code-Size Reduction
논문은 GSA 형식에서 idempotent backward slices를 형식화하고, 건전한 선형 시간의 slice 식별 알고리즘을 제공하며, 비연속 명령어를 병합할 수 있는 slice 기반 코드 크기 축소 방법(SBCR)을 시연하여 LLVM 이진 파일에서 상당한 감소를 이룬다.
Given a value computed within a program, an idempotent backward slice with respect to this value is a maximal subprogram that computes it. An informal notion of an idempotent slice has previously been used by Guimaraes et al. to transform eager into strict evaluation in the LLVM intermediate representation. However, that algorithm is insufficient to be correctly applied to general control-flow graphs. This paper addresses these omissions by formalizing the notion of idempotent backward slices and presenting a sound and efficient algorithm for extracting them from programs in Gated Static Single Assignment (GSA) form. As an example of their practical use, the paper describes how identifying and extracting idempotent backward slices enables a sparse code-size reduction optimization; that is, one capable of merging non-contiguous sequences of instructions within the control-flow graph of a single function or across functions. Experiments with the LLVM test suite show that, in specific benchmarks, this new algorithm achieves code-size reductions up to -7.24% on programs highly optimized by the -Os sequence of passes from clang 17.
연구 동기 및 목표
- 일반 제어 흐름 그래프에 대한 간극을 식별하고 idempotent backward slices의 개념을 형식화한다.
- GSA 형식의 프로그램에서 idempotent backward slices를 추출하기 위한 건전하고 효율적인 알고리즘을 개발한다.
- idempotent 슬라이스가 슬라이스를 개요화하고 병합함으로써 코드 크기 감소 최적화를 가능하게 함을 시연한다.
- LLVM에 슬라이싱 알고리즘을 구현하고 LLVM 테스트 슈트에서 그 효과를 평가한다.
제안 방법
- SSA를 Tu와 Padua의 gating-path 알고리즘을 사용하여 GSA로 변환하여 명시적 데이터-제어 의존성을 얻는다.
- GSA를 순회하여 루프- 및 함수 인식 종료 조건을 가진 idempotent backward slices를 식별한다.
- 식별된 슬라이스를 차단 인터페이스를 가진 독립 실행 가능 함수로 개요화하고 의미론적 건전성(정리 4.2)을 증명한다.
- 두 단계 중복 제거(구조 해싱 및 정형 비교)를 사용하여 동일하거나 의미적으로 동등한 slice 함수를 병합한다.
- I, P, C 매개변수를 사용하여 슬라이스를 개요화할지 그대로 둘지에 대한 비용 모델 기반 결정을 적용한다.
- LLVM 테스트-스위트에서 기초대조(FMSA 및 LLVM IROutliner)와 비교하여 SBCR을 평가하고 코드 크기 변화에 중점을 둔다.

실험 결과
연구 질문
- RQ1SBCR에 대한 이상적 비용 모델 매개변수는 무엇인가?
- RQ2idempotent 슬라이스 개요화가 어느 정도의 코드 크기 감소를 달성할 수 있으며 이는 이전 연구와 어떻게 비교되는가?
- RQ3이전 기법에 비해 슬라이스 개요화의 실행 시간 및 컴파일 오버헤드는 어떤가?
- RQ4슬라이스 개요화 알고리즘의 점근적 동작은 무엇인가?
- RQ5SBCR을 다른 코드 크기 감소 기술과 결합할 때 누적 이점이 있는가?
주요 결과
- Idempotent backward slices는 GSA 형식에서 올바르게 식별될 수 있으며 hammock 구조나 CSSA 속성은 필요하지 않다.
- Backward slicing은 프로그램의 CFG 간선에 선형 시간으로 실행된다.
- SBCR은 -Os 최적화와 결합될 때 기하 평균 기준으로 2007 벤치마크에서 LLVM 이진의 .text 크기를 최대 7.24%까지 감소시킬 수 있다.
- SBCR은 시퀀스 정렬에 의한 함수 병합이나 LLVM IROutliner과 같은 이전 방법으로 포착되지 않은 비연속적이고 교차 함수 슬라이스 기회를 발견한다.
- 제안된 접근법은 기존 기술에 보완적이며 특정 벤치마크에서 상당한 감소를 가져온다(예: AMGmk).
- 건전성 보장은 제공된다: 개요화된 슬라이스는 원래의 기준 값과 해당 슬라이스의 루프 내에서 프로그램 의미를 보존한다.
![Figure 2 : (a) Program with a slice criterion: the instruction $s=s+1$ . (b) Dense slice, adapted from Blazy et al. [ 3 , Fig. 1] . (c) Program in Static Single-Assignment form. (d) Program in Gated Static Single-Assignment form. (e) Idempotent backward slice with respect to SSA variable $s_{3}$ . (](https://ar5iv.labs.arxiv.org/html/2603.09726/assets/x2.png)
더 나은 연구,지금 바로 시작하세요
연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.