가상머신은 중간 코드를 사용하여 프로그램을 단 한번 컴파일하여 여러 플랫폼에 재컴파일 없이 수행될 수 있도록 하는, 플랫폼 독립성을 제공한다. 이러한 가상 머신인 LLVM은 GCC기반의 C/C++ 전단부인 llvm-gcc와 그로 얻 어진 LLVM 바이트코드를 타깃 머신의 어셈블리로 컴파일하여 주는 llc 후단부를 가지고 있으며, 바이트코드를 하 나로 묶는 과정에서도 강력한 최적화를 수행할 수 있다. 본 논문에서는 리눅스 기반의 ARM 스마트폰에서 C/C++ 프로그램을 GCC를 통해 생성된 어셈블리와, 최적화 단계를 달리하여 LLVM을 통해 얻은 어셈블리를 비교하여 LLVM의 성능을 평가하고, 최적화를 비교한다. LLVM은 메모리 접근 부분에서 GCC에 비해 약점을 보이나, 다른 부분의 최적화에선 거의 GCC에 가까운 성능을 보이고, 함수 호출이 자주 일어나는 경우 더 우수한 최적화 성능을 보여준다.
영어
Virtual Machines provide platform independence using intermediate code, by compiling programs into the intermediate bytecode once and then executing it in multiple platforms without recompilation. One such a VM called the LLVM has the llvm-gcc, a GCC-based C/C++ front-end, and the llc, a back-end which compiles the LLVM bytecode into the assembly code for target machines. LLVM can also run aggressive link-time optimizations when linking several bytecode files together into a single LLVM bytecode file. This paper evaluates the performance of the LLVM and analyzes its optimization quality by comparing the assemblies generated by the LLVM to the assemblies generated by the GCC on a linux-based ARM smart phone. Compared to the GCC, the LLVM is weaker in optimizing memory accesses, but is comparable in other optimizations, especially when there are frequent function calls where the LLVM even performs better.
목차
요약 Abstract 1. 서론 2. LLVM의 개요 2.1 LLVM의 동작원리 2.2 LLVM의 구성요소 3. 실험 결과 3.1 실험 환경 3.2 실험 결과 4. 결과 분석 4.1 CaffeinMark 벤치마크 분석 4.2 MiBench 벤치마크 분석 5. 결론 참고문헌