Home      Discussion      Topics      Dictionary      Almanac
Signup       Login
Intermediate representation

Intermediate representation

Overview
In computing
Computing
Computing is usually defined as the activity of using and developing computer technology, computer hardware and software. It is the computer-specific part of information technology...

, an intermediate representation (IR) is a data structure
Data structure
In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks...

 that is constructed from input data to a program
Computer program
Computer programs are instructions for a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute the instructions...

, and from which part or all of the output data of the program is constructed in turn.
Discussion
Ask a question about 'Intermediate representation'
Start a new discussion about 'Intermediate representation'
Answer questions from other users
Full Discussion Forum
 
Encyclopedia
In computing
Computing
Computing is usually defined as the activity of using and developing computer technology, computer hardware and software. It is the computer-specific part of information technology...

, an intermediate representation (IR) is a data structure
Data structure
In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks...

 that is constructed from input data to a program
Computer program
Computer programs are instructions for a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute the instructions...

, and from which part or all of the output data of the program is constructed in turn.

Use of the term usually implies that most of the information
Information
Information as a concept has many meanings, from everyday usage to technical settings. The concept of information is closely related to notions of constraint, communication, control, data, form, instruction, knowledge, meaning, mental stimulus, pattern, perception, and representation.The English...

 present in the input is retained by the intermediate representation, with further annotations or rapid lookup features.

A canonical example is found in most modern compilers, where the linear human-readable text representing a program is transformed into an intermediate graph
Graph (data structure)
In computer science, a graph is an abstract data structure that is meant to implement the graph concept from mathematics.A graph data structure consists mainly of a finite set of ordered pairs, called edges or arcs, of certain entities called nodes or vertices...

 data structure that allows flow analysis and re-arrangements before starting to create the list of actual CPU instructions that will do the work.