Eliminate Branches by Melding IR Instructions
Yuze Li, Srinivasan Ramachandra Sharma, Charitha Saumya, Ali R. Butt, Kirshanthan Sundararajah

TL;DR
MERIT is a compiler technique that eliminates branches by merging similar IR instructions from divergent paths, improving performance especially on architectures where traditional if-conversion struggles.
Contribution
It introduces a novel IR-level merging approach using sequence alignment and operand guarding, enabling branch elimination without hardware predication.
Findings
Achieves 10.9% average speedup on benchmark programs
Peak improvements reach up to 32x over hardware branch predictors
Reduces static instruction overhead compared to traditional methods
Abstract
Branch mispredictions cause catastrophic performance penalties in modern processors, leading to performance loss. While hardware predictors and profile-guided techniques exist, data-dependent branches with irregular patterns remain challenging. Traditional if-conversion eliminates branches via software predication but faces limitations on architectures like x86. It often fails on paths containing memory instructions or incurs excessive instruction overhead by fully speculating large branch bodies. This paper presents Melding IR Instructions (MERIT), a compiler transformation that eliminates branches by aligning and melding similar operations from divergent paths at the IR instruction level. By observing that divergent paths often perform structurally similar operations with different operands, MERIT adapts sequence alignment to discover merging opportunities and employs safe…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Security and Verification in Computing · Radiation Effects in Electronics
