# Redundant Loads: A Software Inefficiency Indicator

**Authors:** Pengfei Su, Shasha Wen, Hailong Yang, Milind Chabbi, Xu Liu

arXiv: 1902.05462 · 2019-02-15

## TL;DR

This paper introduces LoadSpy, a profiler that detects redundant memory load operations in software, revealing optimization opportunities missed by compilers and enabling targeted performance improvements.

## Contribution

The paper presents LoadSpy, a novel whole-program profiler that identifies and quantifies redundant loads in optimized binaries, aiding developers in performance tuning.

## Key findings

- Redundant loads are prevalent in modern software despite compiler optimizations.
- Using LoadSpy-guided optimizations, significant speedups are achieved in benchmarks and real applications.
- LoadSpy effectively associates redundancies with specific code contexts for targeted improvements.

## Abstract

Modern software packages have become increasingly complex with millions of lines of code and references to many external libraries. Redundant operations are a common performance limiter in these code bases. Missed compiler optimization opportunities, inappropriate data structure and algorithm choices, and developers' inattention to performance are some common reasons for the existence of redundant operations. Developers mainly depend on compilers to eliminate redundant operations. However, compilers' static analysis often misses optimization opportunities due to ambiguities and limited analysis scope; automatic optimizations to algorithmic and data structural problems are out of scope.   We develop LoadSpy, a whole-program profiler to pinpoint redundant memory load operations, which are often a symptom of many redundant operations. The strength of LoadSpy exists in identifying and quantifying redundant load operations in programs and associating the redundancies with program execution contexts and scopes to focus developers' attention on problematic code. LoadSpy works on fully optimized binaries, adopts various optimization techniques to reduce its overhead, and provides a rich graphic user interface, which make it a complete developer tool. Applying LoadSpy showed that a large fraction of redundant loads is common in modern software packages despite highest levels of automatic compiler optimizations. Guided by LoadSpy, we optimize several well-known benchmarks and real-world applications, yielding significant speedups.

---
Source: https://tomesphere.com/paper/1902.05462