Download presentation
Presentation is loading. Please wait.
1
CStar Optimizing a C Compiler
Group Hellim
2
GROUP MEMBERS - Halit Emre Sayılır - Anıl Koyuncu - Kutay Yıldırıcı
- Tayfun Çakıcıer
3
OUTLINE Problem Definition Framework Information Modules
1 Optimizations 2 Optimization Manager 3 Test Case Generator Screenshots
4
PROBLEM DEFINITION Why Performance and Efficiency
- Reduce Execution Time - Decrease Space of Code - Reduce Memory Space Must be Reliable
5
FRAMEWORK INFO Object Oriented Software Library
Own intermediate representation Design by Contract Modular
6
OPTIMIZATIONS Dead Code Elemination if(0) a=1;
else will be replaced by a=2; a=2; Evaluation of if statement in run time avoided Space of code reduced
7
OPTIMIZATIONS(cont.) Constant Folding return 100*40 return 4000
8
OPTIMIZATIONS(cont.) Local Copy Propagation a=b; c=a+d; c = b + d ;
also after dead code elimination
9
OPTIMIZATIONS (%35) Constant Folding (+) Basic Block Ordering
Dead Code Elimination Local/Global Forward Substitution Local/Global Copy Propagation(+) Strength Reduction (+) Local/Global Common SubExpression Elimination (+) If Simplifications Algebraic Simplifications (+)
10
OPTIMIZATIONS(cont.) Dead Object Elimination Jump Optimizations
Tail Merging Tail Recursion Procedure Cloning and Specilization Partial Redundancy Elimination Unreachable Code Elimination (+)
11
OPTIMIZATION MANAGER (%40)
A tool for managing the optimizations which will be used during compilation An assistant for advanced users
12
OPTIMIZATION MANAGER Two modes: 1- File mode:
There is an external file. The optimizations which will be used ,are configured in the file When the file is read , rules will be managed and then chosen optimizations will be executed
13
Optimization Manager Configuration File
14
OPTIMIZATION MANAGER 2- Interactive mode:
It is a mode which interacts with user. The user will enter input via keyboard. Optimizations will be done in an interactive manner.
15
TEST CASE GENERATOR (%30)
Aim: Automating the process of test case generation * Reduce and prevent human errors * Flexibility for generation of different test cases
16
TEST CASE GENERATOR How Option File Inspection
17
OPTION FILE
18
TEST CASE GENERATOR How Parse Option File Generate Options Option File
Inspection IR Dump IR Code Generation Generated Test File
19
Screenshots Some result screenshots of the optimizations
20
Constant Folding
21
Algebraic Simplifications
22
Local Common Subexpression Elimination
23
QUESTIONS ? ? ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.