← ⚙️ Code Generation & Register Allocation
Subtopic 2 of 3

10.2Register allocation by graph colouring

Variables are nodes; an edge joins variables live at the same time. A k-colouring assigns k registers; if impossible some variable is spilled to memory.

abcde

    Edge = the two variables are live at the same time, so they cannot share a register.

    Previous year questions: Code Generation & Register Allocation (3)

    PYQs are grouped by topic, so this is the full set for Code Generation & Register Allocation; try the ones that match this subtopic. Open all 3 on the topic page.