SlideShare a Scribd company logo
1 of 12
NADAR SARASWATHI COLLEGE OF
ARTS AND SCIENCE
DEPARTMENT OF COMPUTER SCIENCE
PEEPHOLE OPTIMIZATION
BY
M.VIDHYA
1.MSC(CS)
CONTENTS:
 What is an optimization
 Introduction
 Working flow of peephole optimization
 Replacement rules
 functioning of peephole optimization&example
conclusion
WHAT IS OPTIMIZATION??
Process of transformation a piece of code to
make it more efficient(either in terms of time or
space)without changing its output or side-
effects.
 Tries to minimize or maximize some attributes
of an executable computer program.
INTRODUCTION:
Optimization performed over a very small set
of instruction in a segment of generated code.
Works by recognizing sets of instruction that
can be replaced by shorter or faster sets of
instructions.
GOALS :
Improve performance
Reduce code size
Reduce memory footprint
WORKING FLOW OF PEEPHOLE OPTIMIZATION
REPLACEMENT RULES:
 Constant folding
-Evaluate constant sub-expression in
advance
 Strength reduction
-Replace slow operations with faster
eqivalents
 Null sequences
-Delete useless operations
FUNCTIONING OF PEEPHOLE
OPTIMIZATION
 Replacing slow instructions with faster
ones
 Removing redundant code
 Removing redundant stack instructions
Functioning (contd…)
 Replacing slow instructions with faster ones
……
load1
load1
mul
…..
Can be replaced by
…..
load 1
dup
mul
……
CONCLUSION:
Peephole optimization remains viable
-Post allocation improvements
-Cleans up rough edges
 Peephole technology works for selection
-Description driven matchers
-Used in several important systems
All of this work equally well in binary-to-binary
translation.
THANK YOU

More Related Content

What's hot

Code Optimization
Code OptimizationCode Optimization
Code Optimization
guest9f8315
 

What's hot (20)

Linker and Loader Explained
Linker and Loader  ExplainedLinker and Loader  Explained
Linker and Loader Explained
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Shell Scripting Tutorial | Edureka
Shell Scripting Tutorial | EdurekaShell Scripting Tutorial | Edureka
Shell Scripting Tutorial | Edureka
 
Assembler
AssemblerAssembler
Assembler
 
Heap Management
Heap ManagementHeap Management
Heap Management
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programming
 
What is keyword in c programming
What is keyword in c programmingWhat is keyword in c programming
What is keyword in c programming
 
Compiler Chapter 1
Compiler Chapter 1Compiler Chapter 1
Compiler Chapter 1
 
Basic of compiler
Basic of compiler Basic of compiler
Basic of compiler
 
Basic MIPS implementation
Basic MIPS implementationBasic MIPS implementation
Basic MIPS implementation
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Assembler
AssemblerAssembler
Assembler
 
Phases of compiler
Phases of compilerPhases of compiler
Phases of compiler
 
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generation
 
Compilers
CompilersCompilers
Compilers
 
Optimization of basic blocks
Optimization of basic blocksOptimization of basic blocks
Optimization of basic blocks
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Partial redundancy elimination
Partial redundancy eliminationPartial redundancy elimination
Partial redundancy elimination
 
Program execution
Program executionProgram execution
Program execution
 

Similar to Peephole optimization

CODE TUNINGtertertertrtryryryryrtytrytrtry
CODE TUNINGtertertertrtryryryryrtytrytrtryCODE TUNINGtertertertrtryryryryrtytrytrtry
CODE TUNINGtertertertrtryryryryrtytrytrtry
kapib57390
 
Compiler Optimization-Space Exploration
Compiler Optimization-Space ExplorationCompiler Optimization-Space Exploration
Compiler Optimization-Space Exploration
tmusabbir
 
Presentation
PresentationPresentation
Presentation
butest
 
Design and Implementation of Low Power DSP Core with Programmable Truncated V...
Design and Implementation of Low Power DSP Core with Programmable Truncated V...Design and Implementation of Low Power DSP Core with Programmable Truncated V...
Design and Implementation of Low Power DSP Core with Programmable Truncated V...
ijsrd.com
 
Apache Hadoop India Summit 2011 talk "An Extension of Fairshare-Scheduler and...
Apache Hadoop India Summit 2011 talk "An Extension of Fairshare-Scheduler and...Apache Hadoop India Summit 2011 talk "An Extension of Fairshare-Scheduler and...
Apache Hadoop India Summit 2011 talk "An Extension of Fairshare-Scheduler and...
Yahoo Developer Network
 

Similar to Peephole optimization (20)

Peephole Optimization
Peephole OptimizationPeephole Optimization
Peephole Optimization
 
CODE TUNINGtertertertrtryryryryrtytrytrtry
CODE TUNINGtertertertrtryryryryrtytrytrtryCODE TUNINGtertertertrtryryryryrtytrytrtry
CODE TUNINGtertertertrtryryryryrtytrytrtry
 
Compiler Optimization-Space Exploration
Compiler Optimization-Space ExplorationCompiler Optimization-Space Exploration
Compiler Optimization-Space Exploration
 
Power Optimization with Efficient Test Logic Partitioning for Full Chip Design
Power Optimization with Efficient Test Logic Partitioning for Full Chip DesignPower Optimization with Efficient Test Logic Partitioning for Full Chip Design
Power Optimization with Efficient Test Logic Partitioning for Full Chip Design
 
Presentation
PresentationPresentation
Presentation
 
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization ApproachesPragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
 
Ch1
Ch1Ch1
Ch1
 
Ch1
Ch1Ch1
Ch1
 
Parallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMPParallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMP
 
Using Optimal Learning to Tune Deep Learning Pipelines
Using Optimal Learning to Tune Deep Learning PipelinesUsing Optimal Learning to Tune Deep Learning Pipelines
Using Optimal Learning to Tune Deep Learning Pipelines
 
Using Optimal Learning to Tune Deep Learning Pipelines
Using Optimal Learning to Tune Deep Learning PipelinesUsing Optimal Learning to Tune Deep Learning Pipelines
Using Optimal Learning to Tune Deep Learning Pipelines
 
Design and Implementation of Low Power DSP Core with Programmable Truncated V...
Design and Implementation of Low Power DSP Core with Programmable Truncated V...Design and Implementation of Low Power DSP Core with Programmable Truncated V...
Design and Implementation of Low Power DSP Core with Programmable Truncated V...
 
Stefano Doni - Achieve Superhuman Performance with Machine Learning
Stefano Doni - Achieve Superhuman Performance with Machine LearningStefano Doni - Achieve Superhuman Performance with Machine Learning
Stefano Doni - Achieve Superhuman Performance with Machine Learning
 
Innovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilitiesInnovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilities
 
1.prallelism
1.prallelism1.prallelism
1.prallelism
 
1.prallelism
1.prallelism1.prallelism
1.prallelism
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatterns
 
Introducing Performance Awareness in an Integrated Specification Environment
Introducing Performance Awareness in an Integrated Specification EnvironmentIntroducing Performance Awareness in an Integrated Specification Environment
Introducing Performance Awareness in an Integrated Specification Environment
 
Apache Hadoop India Summit 2011 talk "An Extension of Fairshare-Scheduler and...
Apache Hadoop India Summit 2011 talk "An Extension of Fairshare-Scheduler and...Apache Hadoop India Summit 2011 talk "An Extension of Fairshare-Scheduler and...
Apache Hadoop India Summit 2011 talk "An Extension of Fairshare-Scheduler and...
 
OTS - Everything you wanted to know but didn't ask
OTS - Everything you wanted to know but didn't askOTS - Everything you wanted to know but didn't ask
OTS - Everything you wanted to know but didn't ask
 

More from Mvidhya9 (9)

womenempowerment.ppt
womenempowerment.pptwomenempowerment.ppt
womenempowerment.ppt
 
IOT.ppt
IOT.pptIOT.ppt
IOT.ppt
 
Color image processing ppt
Color image processing pptColor image processing ppt
Color image processing ppt
 
artifical intelligence ppt.
artifical intelligence ppt.artifical intelligence ppt.
artifical intelligence ppt.
 
cloud computing ppt
cloud computing pptcloud computing ppt
cloud computing ppt
 
cryptography.pptx
cryptography.pptxcryptography.pptx
cryptography.pptx
 
nosql.PPT.pptx
nosql.PPT.pptxnosql.PPT.pptx
nosql.PPT.pptx
 
DOS.pptx
DOS.pptxDOS.pptx
DOS.pptx
 
python.pptx
python.pptxpython.pptx
python.pptx
 

Recently uploaded

Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Sérgio Sacani
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Sérgio Sacani
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
Lokesh Kothari
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptx
gindu3009
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
Sérgio Sacani
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
Areesha Ahmad
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and Classifications
Areesha Ahmad
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Sérgio Sacani
 

Recently uploaded (20)

Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
Botany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfBotany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdf
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdf
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptx
 
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts ServiceJustdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
 
American Type Culture Collection (ATCC).pptx
American Type Culture Collection (ATCC).pptxAmerican Type Culture Collection (ATCC).pptx
American Type Culture Collection (ATCC).pptx
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and Classifications
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
 
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
 
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
 

Peephole optimization