Abstract
In this paper, we propose a novel algorithm for merging branches in VLIW and superscalar architectures employing multi-way branch mechanisms. The branch merging problem is to find sets of branches that, can be merged and executed concurrently. The advantages of using branch merging are: (1) to reduce the number of stalls due to branches and (2) to enlarge the size of basic blocks. We show that the general branch merging problem is NP-complete, and then propose a heuristic algorithm to solve this problem.