Title | : | Towards Practical Program Analysis Reuse |
Speaker | : | Shashin Halalingaiah (IITM) |
Details | : | Wed, 26 Apr, 2023 3:00 PM @ MR-I(SSB-233) |
Abstract: | : | Data-flow analyses are a powerful class of analyses that compilers -- both static, and runtime (like Java JIT Compilers) -- can employ to vastly improve the precision of other analyses, and to perform powerful code optimizations. However, whole-program data-flow analyses of large Java programs tend to be expensive -- both in terms of time and memory. Due to this, both during static and JIT compilation, we tend to employ faster -- but more conservative -- analyses to improve usability. Various techniques have been proposed to perform the precise yet expensive fixed-point analyses ahead of time in a static analyzer, store the results and then transmit them to further compilation stages that may need them (during another static or JIT compilation task). For example, one may perform a whole-program fixed-point points-to analysis during static compile time, store its re sults and then transmit them to a JIT compiler as an aide to further analyses and optimizations. However, we observe an underlying concern of safety that affects all such techniques -- can the artifacts of an apriori static analysis be trusted by a compiler that has received it? In this work, we address this issue of trust, while keeping the issues of performance efficiency in mind. Considering points-to analysis as a representative example of an iterative data-flow analysis, we propose ART: Analysis results Representation Template – a novel scheme to efficiently encode results of flow-sensitive context-insensitive points-to analysis computed by a static analyzer for use in any independent compiler system that may benefit from such a highly precise points-to analysis. ART also allows for fast regeneration of the encoded sound analysis results in the independent compiler. Our scheme has two components: (i) a producer that can perform expensive static analysis and encode the same concisely. (ii) a consumer that, on receiving such encoded results (called ARTWORK), can regenerate the analysis results encoded by the artwork if it is deemed “safeâ€. The regeneration scheme completely avoids fixed-point computations and thus can help performance-centri c consumers like static analyzers and JIT compilers to obtain precise points-to information without paying a prohibitively high cost. We have implemented this scheme using Soot as the producer, and two consumers: (i) a Soot-based static analysis client and (ii) the Eclipse OpenJ9 JIT Compiler. We have evaluated our implementation over various benchmarks from the DaCapo and SPECjvm2008 suites. Our results demonstrate that ART encoding enables computation of precise flow-sensitive context-insensitive points-to analysis results in a consumer compiler in less than (average) 1% of the time taken by a static analyzer to perform the same analysis, with the storage overhead of ART representing a small fraction of the program size (average < 4%). We also show that the sound and precise points-to analysis results thus obtained can improve the identification of monomorphic calls in both the consumers. |