Journal of Information Processing
Online ISSN : 1882-6652
ISSN-L : 1882-6652
Branch Divergence Reduction Based on Code Motion
Junji FukuharaMunehiro Takimoto
Author information
JOURNAL FREE ACCESS

2020 Volume 28 Pages 302-309

Details
Abstract

The Single Instruction Multiple Data (SIMD) execution model on GPUs enables a program to execute efficiently. Nevertheless, the efficiency may decrease via branch divergence that occurs when SIMD threads follow different paths in branches. Once the branch divergence occurs, some threads have to wait until the completion of other threads. This inefficiency on GPU is caused by instructions included in branches, which may be increased by some traditional code optimizations based on code motion. Partial Redundancy Elimination (PRE) is one of such code motions methods. The PRE causes some insertions of expressions into some paths in branches and increases branch divergence. Thus, we propose a new PRE approach, called Speculative Sparse Code Motion (SSCM), which not only removes redundant expressions but also reduces branch divergence. The SSCM achieves them based on both properties of Sparse Code Motion (SCM) that reduces the static numbers of expressions in addition to PRE and speculative code motion that hoists some expressions in branches out of them. The SCM property of SSCM reduces branch divergence since it also hoists all the expressions in the true and false paths in a branch as a single expression. Moreover, the speculation property helps to hoist all the expressions not hoisted by the SCM, which removes more redundant expressions where speculation is not harmful in branches with branch divergence. Furthermore, the SSCM also enables the selective application of speculative code motion to improve programs with divergent and or non-divergent branches. To prove the effectiveness of our method, we applied it to some benchmarks with divergent branches. Our experimental results demonstrate more than 8% improvement in some program efficiency.

Content from these authors
© 2020 by the Information Processing Society of Japan
Previous article Next article
feedback
Top