Avoiding conditional branches by code replication
Frank Mueller, David B. Whalley · Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation · 1995
On-chip instruction caches are increasing in size.Compiler writers are exploiting this fact by applying a variety of optimization that improve the execution performance of a program at the expense of increasing its code size.This paper describes a new optimization that can be used to avoid conditional branches by replicating code.The central idea is to determine if there are paths where the result of a conditional branch will be known and to replicate code to exploit it.Algorithms are described for detecting when branches are avoidable, for restructuring the control flow to avoid these branches, and for positioning the replicated blocks in the restructured code.The results indicate that the optimization can be frequently applied with reductions in both the number of instructions executed and total instruction cache work.
Cited by 87 works. doi:10.1145/207110.207116 Open-access PDF
Authors
References
- Computer Architecture: A Quantitative Approach
- Cache Memories
- Global optimization by suppression of partial redundancies
- A portable global optimizer and linker
- Compiler Design Theory
- A portable global optimizer and linker
- Improving the accuracy of static branch prediction using branch correlation
- Loop Transformations for Restructuring Compilers: The Foundations
- A design environment for addressing architecture and compiler interactions
- Improving the accuracy of static branch prediction using branch correlation