spo600:2025_winter_project
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
spo600:2025_winter_project [2025/02/18 14:37] – [Project Stage 1: Create a Basic GCC Pass] chris | spo600:2025_winter_project [2025/03/14 10:21] (current) – chris | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== SPO600 2025 Winter Project ====== | ====== SPO600 2025 Winter Project ====== | ||
+ | |||
+ | ==== Before Starting ==== | ||
+ | |||
+ | Before starting this project, please perform [[GCC Build Lab|Lab 4]]. | ||
===== Project Stage 1: Create a Basic GCC Pass ===== | ===== Project Stage 1: Create a Basic GCC Pass ===== | ||
Line 9: | Line 13: | ||
- Prints a count of the number of gimple statements in each function. | - Prints a count of the number of gimple statements in each function. | ||
- | Your code must build on the [[SPO600 Servers]]. | + | Your code must build on both of the [[SPO600 Servers]]. |
It is recommended that you proceed in steps: | It is recommended that you proceed in steps: | ||
Line 15: | Line 19: | ||
* Add logic to iterate through the code in the program being compiled | * Add logic to iterate through the code in the program being compiled | ||
* Incrementally add logic to count the basic blocks and gimple statements | * Incrementally add logic to count the basic blocks and gimple statements | ||
- | |||
It is recommended that you position your compiler pass __late__ in the compilation/ | It is recommended that you position your compiler pass __late__ in the compilation/ | ||
Line 21: | Line 24: | ||
==== Resources ==== | ==== Resources ==== | ||
- | See [[Creating a GCC Pass]]. | + | * [[Creating a GCC Pass]]. |
+ | * [[Building GCC]] | ||
==== Recommendations for Building GCC ==== | ==== Recommendations for Building GCC ==== | ||
Line 43: | Line 47: | ||
* Add your reflections on the experience - what you learned, what you found interesting, | * Add your reflections on the experience - what you learned, what you found interesting, | ||
* I recommend that you blog about your work in multiple sections - blog as you go rather than waiting and writing one massive blog post at the end of each stage. | * I recommend that you blog about your work in multiple sections - blog as you go rather than waiting and writing one massive blog post at the end of each stage. | ||
+ | * Assuming that the basic work is done well, extending your Stage 1 work with particularly well-formatted dump text or additional detail in the output could improve your mark. | ||
==== Due Date ==== | ==== Due Date ==== | ||
- | * Stage 1 is due with the second batch of blog posts on March 9, 2025. | + | * Stage 1 is due with the second batch of blog posts <del>on March 9, 2025</ |
+ | * This stage of the project is worth 15% of the course total. | ||
+ | |||
+ | ===== Project Stage 2: Clone-Pruning Analysis Pass ===== | ||
+ | |||
+ | Create a pass for the GCC compiler which analyzes the program being compiled and: | ||
+ | - Identifies one or more functions which have been cloned. These functions will have the name ''// | ||
+ | - Examines the cloned functions to determine if they are substantially the same or different. " | ||
+ | - Emit a message in the GCC diagnostic dump for the pass that indicates if the functions should be pruned (in the case that they' | ||
+ | |||
+ | It is recommended that you proceed in steps: | ||
+ | * Start with your code from Stage I | ||
+ | * Add the logic to find the cloned function(s) | ||
+ | * Add the locic to compare the gimple representation of the funtion(s) | ||
+ | * Add the code to output a decision on whether the functions should or should not be pruned | ||
+ | |||
+ | To limit complexity, you may make these assumptions: | ||
+ | * There is only one cloned function in a program | ||
+ | * There are only two versions (clones) of that function (ignoring the function resolver) | ||
+ | |||
+ | However, if you choose to handle multiple cloned functions, or more than two clones, that would be a welcome enhancement! | ||
+ | |||
+ | It is important that you position your compiler pass __late__ in the compilation/ | ||
+ | |||
+ | Two possible approaches to this problem are (1) to iterate through the statements in each function, comparing them statement-by-statement; | ||
+ | |||
+ | You must output one of these specific strings in your dump file, each on its own line, conditional on whether the cloned functions are the same (PRUNE) or different (NOPRUNE): | ||
+ | * '' | ||
+ | * '' | ||
+ | Where // | ||
+ | |||
+ | Your solution should build and execute successfully on both x86_64 and aarch64 systems, and should take into account the differences between the FMV implementations on those two architectures (for example, the munging algorithm used to create the suffixes for the cloned functions is different). | ||
+ | |||
+ | ==== Test Cases for Pruning/ | ||
+ | |||
+ | Each of the [[SPO600 Servers]] has a file ''/ | ||
+ | |||
+ | Refer to the README.txt file within the tgz file for more detail. | ||
+ | |||
+ | Your code must be able to correctly output PRUNE or NOPRUNE messages for the test programs on each platform. | ||
+ | |||
+ | ==== Submitting your Project Stage 2 ==== | ||
+ | |||
+ | Blog your results: | ||
+ | * Include detailed results for the items above. Be specific, detailed, and conclusive in your reporting. | ||
+ | * Clearly identify the capabilities and limitations of your code. | ||
+ | * Enable __easy__ replication of your results. For example, you could provide links to specific content in a Git repository of your experiments. Avoid presenting code as screenshots whenever possible, because screenshots are not searchable, indexable, testable, nor accessible. **Your code __must__ be easily testable.** | ||
+ | * Add your reflections on the experience - what you learned, what you found interesting, | ||
+ | * Identify technical issues and improvements you would like to work on in Stage III of your project. | ||
+ | * I recommend that you blog about your work in multiple sections - blog as you go rather than waiting and writing one massive blog post at the end of each stage. | ||
+ | |||
+ | ==== Due Date ==== | ||
+ | |||
+ | * Stage 2 is due with the third batch of blog posts on March 6, 2024. | ||
+ | * This stage of the project is worth 15% of the course total. | ||
spo600/2025_winter_project.1739889435.txt.gz · Last modified: 2025/02/18 14:37 by chris