Static analysis of energy consumption for LLVM IR programs

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

Research output: Chapter in Book/Report/Conference proceedingConference Contribution (Conference Proceeding)

27 Citations (Scopus)
193 Downloads (Pure)


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.
Original languageEnglish
Title of host publicationProceedings of the 18th International Workshop on Software and Compilers for Embedded Systems (SCOPES '15)
PublisherAssociation for Computing Machinery (ACM)
Number of pages9
ISBN (Print)9781450335935
Publication statusPublished - 1 Jun 2015
Event18th International Workshop on Software and Compilers for Embedded Systems, SCOPES 2015 - St. Goar, Germany
Duration: 1 Jun 20153 Jun 2015


Conference18th International Workshop on Software and Compilers for Embedded Systems, SCOPES 2015
CitySt. Goar


  • Energy estimation
  • Software analysis

Fingerprint Dive into the research topics of 'Static analysis of energy consumption for LLVM IR programs'. Together they form a unique fingerprint.

Cite this