Skip to content
CY-603 (C) · Autometa & Compiler design/Important Questions

Autometa & Compiler design (CY-603 (C)) - Important Questions

  1. Unit 514 Marks High Priority

    Explain loop optimization techniques used by compilers. Discuss at least three techniques such as loop-invariant code motion, induction-variable elimination, and loop unrolling. For each technique, give an example, explain why it improves performance, and mention any trade-offs or code-size impacts.

    Core topic from Unit 5: loop optimization techniques (explicitly called out in analytics heatmap). Highly recurring and tested as long-answer/problem question.

  2. Unit 57 Marks High Priority

    What is dead code? Explain dead code elimination. Describe an algorithm to detect and remove dead code using data-flow information, and illustrate the method with an example.

    Core topic from Unit 5: dead code elimination is explicitly highlighted in the analytics heatmap and commonly asked as a distinct question or as part of optimization questions.

  3. Unit 510 Marks Medium Priority

    Explain local and global common subexpression elimination. Define the data-flow problem for available expressions and show how the solution is used to eliminate common subexpressions across basic blocks. Work through a program example and show the transformed code.

    Important optimization technique closely tied to data-flow frameworks; commonly appears in exam questions requiring derivation of available expressions and their use in optimization.

  4. Unit 57 Marks Medium Priority

    What is peephole optimization? Describe common peephole transformations with examples and explain how pattern matching is used in a peephole optimizer.

    Short-answer/definition style question typical for Unit 5; often asked for quick marks.

  5. Unit 514 Marks Medium Priority

    Define basic block and control-flow graph (CFG). Given a short program fragment, construct its CFG, identify basic blocks, and apply DAG-based optimization on one selected basic block to remove common subexpressions and redundant computations. Show the optimized code.

    Standard exam question pattern: combining CFG/basic blocks with optimization (DAG for basic block). Frequently appears as a specimen long question.

  6. Unit 514 Marks Medium Priority

    Explain liveness analysis and show how liveness information is computed on a control-flow graph. Using the computed liveness sets, describe the graph-coloring approach to register allocation and demonstrate register assignment for a given basic block or small function.

    Backend optimization staple: register allocation and liveness analysis are standard long-answer topics in Unit 5 and related back-end units.

  7. Unit 57 Marks Medium Priority

    What is strength reduction? Give examples of strength reduction within loops (for example, replacing multiplication by addition) and explain how compilers detect and apply this optimization safely.

    Specific loop-strength optimization often tested as part of loop optimization questions or as a short-question item.

  8. Unit 57 Marks Low Priority

    Write short notes on interprocedural optimizations. Explain the goals of interprocedural analysis, examples of optimizations enabled by it (such as inline expansion and interprocedural constant propagation), and the challenges involved.

    Broader optimization topic that extends optimizations across procedure boundaries; often asked as a short note or conceptual question.

Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in