Removing redundancy via exception check motion

  • Authors:
  • Vijay Sundaresan;Mark Stoodley;Pramod Ramarao

  • Affiliations:
  • IBM Canada Ltd., Toronto, ON, Canada;IBM Canada Ltd., Toronto, ON, Canada;IBM Canada Ltd., Toronto, ON, Canada

  • Venue:
  • Proceedings of the 6th annual IEEE/ACM international symposium on Code generation and optimization
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

Partial redundancy elimination aims to reduce the number of times an expression is computed more than once. The traditional Lazy Code Motion (LCM) algorithm formulated by Knoop, Ruthing and Steffen, through its reliance on unordered bit vectors, is severely limited in its ability to remove redundancy when precise exception semantics are required because bit vectors cannot express the order of exception checks. This paper describes our new PRE algorithm Exception Check Motion that uses the LCM algorithm to treat and optimize exception checks in a similar way to any other expression. Unlike earlier techniques that can remove only the compare instruction of a partially redundant exception check, our solution can eliminate both the compare and trap instructions without any run time code patching or expensive recovery operations. Since it is the trap instructions that restrict subsequent code motions, our technique gives downstream optimizations more flexibility to improve the performance of the resulting code once the partially redundant checks are eliminated. Our analysis has been implemented in the IBM® Testarossa (TR) just-in-time (JIT) compiler in the IBM Developer Kit for Java Release 5.0 as part of the J9 Virtual Machine. We measure performance improvements up to 7.6% and averaging 2.5% across 22 SPEC and DaCapo benchmarks on 4-way IBM pSeries (PowerPC) hardware.