CStar Optimizing a C Compiler Group Hellim. 2/19 GROUP MEMBERS - Halit Emre Sayılır - Anıl...
-
date post
21-Dec-2015 -
Category
Documents
-
view
244 -
download
0
Transcript of CStar Optimizing a C Compiler Group Hellim. 2/19 GROUP MEMBERS - Halit Emre Sayılır - Anıl...
CStarOptimizing a C Compiler
Group Hellim
2/19
GROUP MEMBERS
- Halit Emre Sayılır
- Anıl Koyuncu
- Kutay Yıldırıcı
- Tayfun Çakıcıer
3/19
OUTLINE
• Problem Definition
• Framework Information
• Modules
1 Optimizations
2 Optimization Manager
3 Test Case Generator
• Screenshots
4/19
Why• Performance and Efficiency
- Reduce Execution Time- Decrease Space of Code- Reduce Memory Space
• Must be Reliable
PROBLEM DEFINITION
5/19
FRAMEWORK INFO
• Object Oriented Software Library
• Own intermediate representation
• Design by Contract
• Modular
6/19
OPTIMIZATIONSDead Code Elemination
if(0)
a=1;
else will be replaced bya=2; a=2;
Evaluation of if statement in run time avoided
Space of code reduced
7/19
OPTIMIZATIONS(cont.)
Constant Folding
return 100*40 return 4000
8/19
Local Copy Propagation
a=b;
c=a+d;
OPTIMIZATIONS(cont.)
c = b + d ;
also after dead code elimination
9/19
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/19
OPTIMIZATIONS(cont.)
• Dead Object Elimination
• Jump Optimizations
• Tail Merging
• Tail Recursion
• Procedure Cloning and Specilization
• Partial Redundancy Elimination
• Unreachable Code Elimination (+)
11/19
OPTIMIZATION MANAGER(%40)
• A tool for managing the optimizations which will be used during compilation
• An assistant for advanced users
12/19
• 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
OPTIMIZATION MANAGER
13/19
Optimization Manager Configuration File
14/19
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.
OPTIMIZATION MANAGER
15/19
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/19
How
TEST CASE GENERATOR
Option File Inspection
17/19
OPTION FILE
18/19
How
TEST CASE GENERATOR
Option File Inspection
Parse OptionFile
Generate Options
IR CodeGeneration
IR DumpGenerated Test File
19/19
Screenshots
• Some result screenshots of the optimizations
20/19
Constant Folding
21/19
Algebraic Simplifications
22/19
Local Common Subexpression Elimination
23/19
QUESTIONS
? ? ?