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

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

  1. Unit 47 Marks High Priority

    Explain intermediate code generation for simple assignment statements. Describe three-address code (TAC) and show how expressions such as a = b + c * d are translated into TAC.

    Core topic: Intermediate code generation for assignment statements; appears frequently in past papers and is fundamental to Unit 4.

  2. Unit 410 Marks High Priority

    Explain the translation of Boolean expressions into intermediate code using the backpatching technique. Define and illustrate the use of true and false lists and show step-by-step translation for the expression (a < b) && (c != d) with appropriate conditional jumps.

    Core derivation from Unit 4 and the analytics heatmap (boolean expressions / backpatching highly repeated).

  3. Unit 414 Marks High Priority

    Using backpatching, generate three-address code for the following structured statement: if (a < b) then if (c < d) x = y + z; else x = y - z; Explain all backpatching lists and the final resolved jump targets.

    Standard RGPV style question; tests construction of intermediate code for control statements using backpatching.

  4. Unit 47 Marks High Priority

    Define a basic block. Describe the algorithm to partition a sequence of three-address code instructions into basic blocks and construct the corresponding control flow graph (flow-graph).

    Core Unit 4 topic: basic block and control-flow construction; frequent in exams for framing subsequent analyses.

  5. Unit 410 Marks High Priority

    Given the following sequence of three-address instructions, identify leaders, partition into basic blocks, draw the flow-graph, and compute live-in and live-out sets for each block.

    1. t1 = a + b
    2. t2 = t1 * c
    3. if t2 > d goto L1
    4. e = t2 - f
    5. goto L2 L1: g = e + 1 L2: h = g + t2

    Important for register allocation and liveness analysis questions; often paired with flow-graph construction.

  6. Unit 47 Marks High Priority

    Explain how to construct an interference graph from liveness information. For a given basic block, show how live ranges translate into nodes and edges of the interference graph.

    Covers interference graph construction which is the bridge to graph-coloring register allocation; medium frequency but high importance.

  7. Unit 414 Marks High Priority

    Describe graph-coloring register allocation. Explain the steps to color the interference graph, register spilling, and illustrate with an example showing how spills are chosen and handled.

    Core register allocation topic; directly tests techniques students must know (graph-coloring / linear-scan).

  8. Unit 410 Marks Medium Priority

    Explain the linear-scan register allocation algorithm. Compare and contrast linear-scan with graph-coloring allocation in terms of complexity and suitability for JIT compilers.

    Alternate register allocation strategy frequently contrasted with graph-coloring in exams.

  9. Unit 47 Marks Medium Priority

    What is spilling in register allocation? Explain the criteria used to select a variable for spilling and outline the steps to insert spill code into the intermediate representation.

    Practical question linking code generation and register allocation; tests understanding of spilling and runtime handling of temporaries.

  10. Unit 414 Marks High Priority

    Given a program fragment, generate its three-address code, partition it into basic blocks, build the flow-graph, compute liveness, construct the interference graph, and propose a register allocation using graph-coloring. Discuss any spills and how they are handled.

    Synthesis question: ties intermediate code, basic blocks and register allocation together; useful for longer answer format.

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