Access over 20 million homework & study documents

Briefly describe the advantages and disadvantages of using an interme

Content type
User Generated
Rating
Showing Page:
1/2
Briefly describe the advantages and disadvantages of
using an intermediate representation (IR) directly
generating executable code. A9) The loop invariant code
motion (LICM) optimization moves expressions that remain
constant in every iteration of the loop. For a language like
CATS, are you able to write an LICM optimization that
detects every loop-invariant expression and moves the
expression outside the loop? Explain your answer.
Solution
8. Architecture of a compiler consists of following phases.
1. Lexical Analyser.
2. Syntax Analyser.
3. Semantic Analyser.
4. Intermediate Code Generation
5. Code Optimiser.
6. Code Generator.
- Intermediate Code is used to generate an intermediate
code of the given expression.
-Advantage of Intermediate Code Generator is User can
write different back ends for different target machines very
easily.
- The intermediate code generator will try to divide this
expression into sub-expressions and then generate the

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/2

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
Briefly describe the advantages and disadvantages of using an intermediate representation (IR) directly generating executable code. A9) The loop invariant code motion (LICM) optimization moves expressions that remain constant in every iteration of the l oop. For a language like CATS, are you able to write an LICM optimization that detects every loop-invariant expression and moves the expression outside the loop? Explain your answer. Solution 8. Architecture of a compiler consists of following phase s. 1. Lexical Analyser. 2. Syntax Analyser. 3. Semantic Analyser. 4. Intermediate Code Generat ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Very useful material for studying!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4