arXivDaily arXiv每日学术速递 周一至周五更新
北美退伍军人节(Veterans Day),12 日无更新
arXiv 1405.4565cs.PL
收藏

LLVM IR程序能耗的静态分析

Static analysis of energy consumption for LLVM IR programs

Neville Grech, Kyriakos Georgiou, James Pallister, Steve Kerrison, Jeremy Morse, Kerstin Eder

摘要:

能量模型可以通过表征执行处理器的指令集中的每个指令所消耗的能量来构建。这可以用来确定执行一系列汇编指令需要多少能量,而不需要仪器或测量硬件。然而,静态分析低层次的程序结构是困难的,和高层次的程序结构和低层次的能量模型之间的差距需要弥合。我们已经开发出了对程序的中间编译器表示进行静态分析的技术。具体来说,我们的目标是LLVM IR,这是现代编译器(包括Clang)使用的一种表示。使用这些技术,我们可以自动推断出在不同平台下使用不同编译器运行函数时所消耗的能量估计。这样做的挑战之一是确定执行LLVM IR程序段的能量成本,为此我们开发了两种不同的方法。当这些信息与我们的分析结合使用时,我们能够推断出表征特定程序的能量消耗的能量公式。这种方法可以应用于任何面向LLVM工具链的语言,包括C和XC或ARM Cortex-M或XMOS xCORE等架构,重点是嵌入式平台。通过比较静态分析结果与硬件的物理测量结果,在这些平台上验证了我们的技术。静态能耗估计支持节能软件开发,而无需硬件知识。

英文摘要:

Energy models can be constructed by characterizing the energy consumed by executing each instruction in a processor's instruction set. This can be used to determine how much energy is required to execute a sequence of assembly instructions, without the need to instrument or measure hardware. However, statically analyzing low-level program structures is hard, and the gap between the high-level program structure and the low-level energy models needs to be bridged. We have developed techniques for performing a static analysis on the intermediate compiler representations of a program. Specifically, we target LLVM IR, a representation used by modern compilers, including Clang. Using these techniques we can automatically infer an estimate of the energy consumed when running a function under different platforms, using different compilers. One of the challenges in doing so is that of determining an energy cost of executing LLVM IR program segments, for which we have developed two different approaches. When this information is used in conjunction with our analysis, we are able to infer energy formulae that characterize the energy consumption for a particular program. This approach can be applied to any languages targeting the LLVM toolchain, including C and XC or architectures such as ARM Cortex-M or XMOS xCORE, with a focus towards embedded platforms. Our techniques are validated on these platforms by comparing the static analysis results to the physical measurements taken from the hardware. Static energy consumption estimation enables energy-aware software development, without requiring hardware knowledge.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑