Static analysis of energy consumption for LLVM IR programs
- 1 June 2015
- conference paper
- conference paper
- Published by Association for Computing Machinery (ACM) in Proceedings of the 18th International Workshop on Software and Compilers for Embedded Systems
Abstract
Energy models can be constructed by characterizing the energy consumed when 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 and compilers. One of the challenges in doing so is that of determining the 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 by providing instant feedback to the developer, without requiring simulations or hardware knowledge.Keywords
Other Versions
Funding Information
- European Commission (318337)
This publication has 26 references indexed in Scilit:
- Identifying Compiler Options to Minimize Energy Consumption for Embedded PlatformsThe Computer Journal, 2013
- Multivariate amortized resource analysisACM Transactions on Programming Languages and Systems, 2012
- Closed-Form Upper Bounds in Static Cost AnalysisJournal of Automated Reasoning, 2010
- User-Definable Resource Usage Bounds Analysis for Java BytecodeElectronic Notes in Theoretical Computer Science, 2009
- Cost Relation Systems: A Language-Independent Target Language for Cost AnalysisElectronic Notes in Theoretical Computer Science, 2009
- User-Definable Resource Bounds Analysis for Logic ProgramsPublished by Springer Science and Business Media LLC ,2007
- A New Algorithm for Identifying Loops in DecompilationLecture Notes in Computer Science, 2007
- Integrated program debugging, verification, and optimization using abstract interpretation (and the Ciao system preprocessor)Science of Computer Programming, 2005
- Performance analysis of embedded software using implicit path enumerationACM SIGPLAN Notices, 1995
- Mechanical program analysisCommunications of the ACM, 1975