230 likes | 245 Views
CStar Optimizing a C Compiler. Group Hellim. GROUP MEMBERS. - Halit Emre Sayılır - Anıl Koyuncu - Kutay Yıldırıcı - Tayfun Çakıcıer. OUTLINE. Problem Definition Framework Information Modules 1 Optimizations 2 Optimization Manager 3 Test Case Generator Screenshots.
E N D
CStarOptimizing a C Compiler Group Hellim
GROUP MEMBERS - Halit Emre Sayılır - Anıl Koyuncu - Kutay Yıldırıcı - Tayfun Çakıcıer
OUTLINE • Problem Definition • Framework Information • Modules 1 Optimizations 2 Optimization Manager 3 Test Case Generator • Screenshots
PROBLEM DEFINITION Why • Performance and Efficiency - Reduce Execution Time - Decrease Space of Code - Reduce Memory Space • Must be Reliable
FRAMEWORK INFO • Object Oriented Software Library • Own intermediate representation • Design by Contract • Modular
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
OPTIMIZATIONS(cont.) Constant Folding return 100*40 return 4000
OPTIMIZATIONS(cont.) Local Copy Propagation a=b; c=a+d; c = b + d ; also after dead code elimination
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 (+)
OPTIMIZATIONS(cont.) • Dead Object Elimination • Jump Optimizations • Tail Merging • Tail Recursion • Procedure Cloning and Specilization • Partial Redundancy Elimination • Unreachable Code Elimination (+)
OPTIMIZATION MANAGER(%40) • A tool for managing the optimizations which will be used during compilation • An assistant for advanced users
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
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.
TEST CASE GENERATOR(%30) Aim: Automating the process of test case generation * Reduce and prevent human errors * Flexibility for generation of different test cases
TEST CASE GENERATOR How Option File Inspection
TEST CASE GENERATOR How Parse Option File Generate Options Option File Inspection IR Dump IR Code Generation Generated Test File
Screenshots • Some result screenshots of the optimizations
QUESTIONS ? ? ?