Skip to content
Latchkey

What Is Three-Address Code?

Three-address code is a compiler intermediate representation in which every instruction performs one simple operation with at most three operands, usually computing a result from two inputs. Complex expressions are broken into a sequence of such instructions using temporary variables. Its uniform, simple shape makes it convenient for analysis and optimization.

Why it matters

Reducing rich expressions to simple three-operand steps gives optimizations a regular form to work on. It is a common stop on the path from source to machine code.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →