














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
basic concept s of two and three pass compiler architecture.
Typology: Slides
1 / 22
This page cannot be seen from the preview
Don't miss anything!















Register Allocation: Have each value in a register when it is used. Instruction selection IR (^) machine code errors Register allocation Instruction scheduling
Register Allocation: (^) Can change instruction choices and insert LOADs and STOREs. Instruction selection IR (^) machine code errors Register allocation Instruction scheduling
Register Allocation: Optimal register allocation is NP-Complete. Instruction selection IR (^) machine code errors Register allocation Instruction scheduling
Instruction Scheduling: Use all functional units productively. Instruction selection IR (^) machine code errors Register allocation Instruction scheduling
Instruction Scheduling: (^) Optimal scheduling is NP-Complete in nearly all cases. Instruction selection IR (^) machine code errors Register allocation Instruction scheduling
Analyzes IR and rewrites (or transforms ) IR Front End Source code machine code errors Middle End Back End
Primary goal is to reduce running time of the compiled code Front End Source code machine code errors Middle End Back End
(^) Must preserve “meaning” of the code. (^) Measured by values of named variables Front End Source code machine code errors Middle End Back End
Modern optimizers are structured as a series of passes Opt 1
errors Opt 2 Opt n
IR Opt 3
Typical transformations
Move a computation to a less frequently executed place Opt 1
errors Opt 2 Opt n
IR Opt 3
Typical transformations
Specialize some computation based on context Opt 1
errors Opt 2 Opt n
IR Opt 3
Typical transformations Remove useless or unreachable code Opt 1
errors Opt 2 Opt n
IR Opt 3
Typical transformations Encode an idiom in some particularly efficient form Opt 1
errors Opt 2 Opt n
IR Opt 3