Posts

Project Stage III: Cloned Function Analysis - PRUNE vs. NOPRUNE

Image
💥Introduction In this project, I have extended the functionality of my code to handle multiple sets of cloned functions and provide PRUNE / NOPRUNE recommendations. This stage also involved testing on both x86_64 and aarch64 architectures, using a variety of test cases that include multiple cloned functions. Below is an overview of my process, test results, and conclusions. ✅ Code Modifications for Multiple Cloned Functions In Stage II, I assumed that there was only one cloned function per program. However, for Stage III, I updated the code to support multiple cloned functions. I made the following changes: Refactored Function Handling : I adjusted the function analysis logic to iterate through each cloned function and process them individually, ensuring that each function gets its own PRUNE or NOPRUNE recommendation. Recommendation Logic : I modified the recommendation algorithm to handle multiple cloned functions. Now, for each function, the code makes an individual recommend...

Project Stage 2: Part 2( The End)

Image
In this part of the project, I will be analyzing the cloned functions to demonstrate how the Clone-Prune Analysis Pass works in practice. Specifically, I’ll take a closer look at the scale_samples functions from the clone-test-prune and clone-test-noprune test files, which were provided for testing and not created by me. The goal here is to show how the pass successfully identifies substantially identical cloned functions (for pruning) and highlights differences that should prevent pruning. Clone-Prune Test Files Comparison: Let’s start by reviewing the clone-test-prune files. These contain the functions scale_samples.default , scale_samples.Mrng , and scale_samples.resolver . Our goal is to compare scale_samples.default and scale_samples.Mrng , which should be identical and therefore should be pruned. scale_samples.default: scale_samples.Mrng: As you can see, scale_samples.default and scale_samples.Mrng are nearly identical, except for their memory addresses (as highlighte...

PROJET STAGE 2 PART 1 CLONE-PRUNE ANALYSIS

Image
👀Introduction: In this blog, I’ll be sharing the steps I followed to complete Project Stage 2 for my course on Software Portability and Optimization. This stage focuses on detecting cloned functions within a codebase and pruning them if they are substantially the same. The key steps involve identifying function clones, comparing them for similarity, and implementing a pass that helps the compiler decide whether to prune the cloned functions or keep them.                                        Before Starting lets understand what are cloned functions. Understanding Cloned Functions in GCC Cloned functions are a result of compiler optimizations, particularly in GCC , where a function is duplicated to create specialized versions tailored for specific use cases. These specialized versions of functions are created to improve performance by exploiting certain known conditions during the comp...