Interprocedural conditional branch elimination

Rastislav Bodík, Rajiv Gupta, Mary Lou Soffa
1997 Proceedings of the ACM SIGPLAN 1997 conference on Programming language design and implementation - PLDI '97  
The existence of statically detectable correlation among conditional branches enables their elimination, an optimization that has a number of benefits. This paper presents techniques to determine whether an interprocedural execution path leading to a conditional branch exists along which the branch outcome is known at compile time, and then to eliminate the branch along this path through code restructuring. The technique consists of a demand driven interprocedural analysis that determines
more » ... r a specific branch outcome is correlated with prior statements or branch outcomes. The optimization is performed using a code restructuring algorithm that replicates code to separate out the paths with correlation. When the correlated path is affected by a procedure call, the restructuring is based on procedure entry splitting and esit splitting. The entry splitting transformation creates multiple entries to a procedure, and the ezit splitting transformation allows a procedure to return control to one of several return points in the caller. Our technique is efficient in that the correlation detection is demand driven, thus avoiding exhaustive analysis of the entire program, and the restructuring never increases the number of operations along a path through an inter-procedural control flow graph. We describe the benefits of our inter-procedural branch ehmination optimization (ICBE). Our experimental results show that, for the same amount of code growth, the estimated reduction in executed conditional branches is about 2.5 times higher with the ICBE optimization than when only intraprocedural conditional branch elimination is applied.
doi:10.1145/258915.258929 dblp:conf/pldi/BodikGS97 fatcat:grrq4u5upfeevhmcrt5x4zt4la