<s>
An	O
intermediate	B-Application
representation	I-Application
(	O
IR	B-Application
)	O
is	O
the	O
data	B-General_Concept
structure	I-General_Concept
or	O
code	O
used	O
internally	O
by	O
a	O
compiler	B-Language
or	O
virtual	B-Architecture
machine	I-Architecture
to	O
represent	O
source	O
code	O
.	O
</s>
<s>
An	O
IR	B-Application
is	O
designed	O
to	O
be	O
conducive	O
to	O
further	O
processing	O
,	O
such	O
as	O
optimization	B-Application
and	O
translation	B-Application
.	O
</s>
<s>
A	O
"	O
good	O
"	O
IR	B-Application
must	O
be	O
accurate	O
–	O
capable	O
of	O
representing	O
the	O
source	O
code	O
without	O
loss	O
of	O
information	O
–	O
and	O
independent	O
of	O
any	O
particular	O
source	O
or	O
target	O
language	O
.	O
</s>
<s>
An	O
IR	B-Application
may	O
take	O
one	O
of	O
several	O
forms	O
:	O
an	O
in-memory	O
data	B-General_Concept
structure	I-General_Concept
,	O
or	O
a	O
special	O
tuple	B-Application
-	O
or	O
stack-based	O
code	O
readable	O
by	O
the	O
program	O
.	O
</s>
<s>
A	O
canonical	O
example	O
is	O
found	O
in	O
most	O
modern	O
compilers	B-Language
.	O
</s>
<s>
For	O
example	O
,	O
the	O
CPython	B-Language
interpreter	I-Language
transforms	O
the	O
linear	O
human-readable	O
text	O
representing	O
a	O
program	O
into	O
an	O
intermediate	O
graph	B-Application
structure	I-Application
that	O
allows	O
flow	O
analysis	O
and	O
re-arrangement	O
before	O
execution	O
.	O
</s>
<s>
Use	O
of	O
an	O
intermediate	B-Application
representation	I-Application
such	O
as	O
this	O
allows	O
compiler	B-Language
systems	O
like	O
the	O
GNU	B-Application
Compiler	I-Application
Collection	I-Application
and	O
LLVM	B-Application
to	O
be	O
used	O
by	O
many	O
different	O
source	O
languages	O
to	O
generate	B-Application
code	I-Application
for	O
many	O
different	O
target	O
architectures	B-General_Concept
.	O
</s>
<s>
An	O
intermediate	O
language	O
is	O
the	O
language	O
of	O
an	O
abstract	B-Application
machine	I-Application
designed	O
to	O
aid	O
in	O
the	O
analysis	O
of	O
computer	B-Application
programs	I-Application
.	O
</s>
<s>
The	O
term	O
comes	O
from	O
their	O
use	O
in	O
compilers	B-Language
,	O
where	O
the	O
source	O
code	O
of	O
a	O
program	O
is	O
translated	O
into	O
a	O
form	O
more	O
suitable	O
for	O
code-improving	B-Application
transformations	I-Application
before	O
being	O
used	O
to	O
generate	O
object	B-Application
or	O
machine	B-Language
code	I-Language
for	O
a	O
target	O
machine	B-Language
.	O
</s>
<s>
The	O
design	O
of	O
an	O
intermediate	O
language	O
typically	O
differs	O
from	O
that	O
of	O
a	O
practical	O
machine	B-Language
language	I-Language
in	O
three	O
fundamental	O
ways	O
:	O
</s>
<s>
"	O
shift-add	O
"	O
addressing	B-Language
modes	I-Language
common	O
in	O
microprocessors	B-Architecture
are	O
not	O
present	O
.	O
</s>
<s>
Control	O
flow	O
information	O
may	O
not	O
be	O
included	O
in	O
the	O
instruction	B-General_Concept
set	I-General_Concept
.	O
</s>
<s>
The	O
number	O
of	O
processor	B-General_Concept
registers	I-General_Concept
available	O
may	O
be	O
large	O
,	O
even	O
limitless	O
.	O
</s>
<s>
A	O
popular	O
format	O
for	O
intermediate	B-Application
languages	I-Application
is	O
three-address	B-Application
code	I-Application
.	O
</s>
<s>
The	O
term	O
is	O
also	O
used	O
to	O
refer	O
to	O
languages	O
used	O
as	O
intermediates	O
by	O
some	O
high-level	B-Language
programming	I-Language
languages	I-Language
which	O
do	O
not	O
output	O
object	B-Application
or	O
machine	B-Language
code	I-Language
themselves	O
,	O
but	O
output	O
the	O
intermediate	O
language	O
only	O
.	O
</s>
<s>
This	O
intermediate	O
language	O
is	O
submitted	O
to	O
a	O
compiler	B-Language
for	O
such	O
language	O
,	O
which	O
then	O
outputs	O
finished	O
object	B-Application
or	O
machine	B-Language
code	I-Language
.	O
</s>
<s>
This	O
is	O
usually	O
done	O
to	O
ease	O
the	O
process	O
of	O
optimization	B-Application
or	O
to	O
increase	O
portability	O
by	O
using	O
an	O
intermediate	O
language	O
that	O
has	O
compilers	B-Language
for	O
many	O
processors	B-General_Concept
and	O
operating	B-General_Concept
systems	I-General_Concept
,	O
such	O
as	O
C	B-Language
.	O
Languages	O
used	O
for	O
this	O
fall	O
in	O
complexity	O
between	O
high-level	B-Language
languages	I-Language
and	O
low-level	B-Language
languages	I-Language
,	O
such	O
as	O
assembly	B-Language
languages	I-Language
.	O
</s>
<s>
Though	O
not	O
explicitly	O
designed	O
as	O
an	O
intermediate	O
language	O
,	O
C	B-Language
's	O
nature	O
as	O
an	O
abstraction	O
of	O
assembly	B-Language
and	O
its	O
ubiquity	O
as	O
the	O
de	O
facto	O
system	B-Language
language	I-Language
in	O
Unix-like	B-Operating_System
and	O
other	O
operating	B-General_Concept
systems	I-General_Concept
has	O
made	O
it	O
a	O
popular	O
intermediate	O
language	O
:	O
Eiffel	B-Language
,	O
Sather	B-Application
,	O
Esterel	B-Language
,	O
some	O
dialects	O
of	O
Lisp	B-Language
(	O
Lush	O
,	O
Gambit	B-Language
)	O
,	O
Haskell	B-Language
(	O
Glasgow	B-Application
Haskell	I-Application
Compiler	I-Application
)	O
,	O
Squeak	B-Operating_System
's	O
Smalltalk-subset	O
Slang	O
,	O
Nim	B-Application
,	O
Cython	B-Application
,	O
Seed7	B-Language
,	O
SystemTap	B-Application
,	O
Vala	B-Language
,	O
V	O
,	O
and	O
others	O
make	O
use	O
of	O
C	B-Language
as	O
an	O
intermediate	O
language	O
.	O
</s>
<s>
Variants	O
of	O
C	B-Language
have	O
been	O
designed	O
to	O
provide	O
C	B-Language
's	O
features	O
as	O
a	O
portable	O
assembly	B-Language
language	I-Language
,	O
including	O
C--	B-Language
and	O
the	O
C	B-Language
Intermediate	O
Language	O
.	O
</s>
<s>
Any	O
language	O
targeting	O
a	O
virtual	B-Architecture
machine	I-Architecture
or	O
p-code	B-Language
machine	I-Language
can	O
be	O
considered	O
an	O
intermediate	O
language	O
:	O
</s>
<s>
Microsoft	O
's	O
Common	O
Intermediate	O
Language	O
is	O
an	O
intermediate	O
language	O
designed	O
to	O
be	O
shared	O
by	O
all	O
compilers	B-Language
for	O
the	O
.NET	B-Application
Framework	I-Application
,	O
before	O
static	O
or	O
dynamic	O
compilation	B-Language
to	O
machine	B-Language
code	I-Language
.	O
</s>
<s>
While	O
most	O
intermediate	B-Application
languages	I-Application
are	O
designed	O
to	O
support	O
statically	O
typed	O
languages	O
,	O
the	O
Parrot	B-Language
intermediate	I-Language
representation	I-Language
is	O
designed	O
to	O
support	O
dynamically	O
typed	O
languages	O
—	O
initially	O
Perl	O
and	O
Python	O
.	O
</s>
<s>
TIMI	O
is	O
used	O
by	O
compilers	B-Language
on	O
the	O
IBM	B-Application
i	I-Application
platform	O
.	O
</s>
<s>
The	O
GNU	B-Application
Compiler	I-Application
Collection	I-Application
(	O
GCC	B-Application
)	O
uses	O
several	O
intermediate	B-Application
languages	I-Application
internally	O
to	O
simplify	O
portability	O
and	O
cross-compilation	B-Application
.	O
</s>
<s>
GCC	B-Application
supports	O
generating	O
these	O
IRs	B-Application
,	O
as	O
a	O
final	O
target	O
:	O
</s>
<s>
The	O
LLVM	B-Application
compiler	B-Language
framework	O
is	O
based	O
on	O
the	O
LLVM	B-Application
IR	B-Application
intermediate	O
language	O
,	O
of	O
which	O
the	O
compact	O
,	O
binary	O
serialized	O
representation	O
is	O
also	O
referred	O
to	O
as	O
"	O
bitcode	O
"	O
and	O
has	O
been	O
productized	O
by	O
Apple	O
.	O
</s>
<s>
Like	O
GIMPLE	O
Bytecode	O
,	O
LLVM	B-Application
Bitcode	O
is	O
useful	O
in	O
link-time	O
optimization	B-Application
.	O
</s>
<s>
Like	O
GCC	B-Application
,	O
LLVM	B-Application
also	O
targets	O
some	O
IRs	B-Application
meant	O
for	O
direct	O
distribution	O
,	O
including	O
Google	O
's	O
PNaCl	B-Application
IR	B-Application
and	O
SPIR	B-Application
.	O
</s>
<s>
A	O
further	O
development	O
within	O
LLVM	B-Application
is	O
the	O
use	O
of	O
Multi-Level	O
Intermediate	B-Application
Representation	I-Application
(	O
MLIR	O
)	O
with	O
the	O
potential	O
to	O
generate	B-Application
code	I-Application
for	O
different	O
heterogeneous	O
targets	O
,	O
and	O
to	O
combine	O
the	O
outputs	O
of	O
different	O
compilers	B-Language
.	O
</s>
<s>
The	O
ILOC	O
intermediate	O
language	O
is	O
used	O
in	O
classes	O
on	O
compiler	B-Language
design	O
as	O
a	O
simple	O
target	O
language	O
.	O
</s>
<s>
Static	O
analysis	O
tools	O
often	O
use	O
an	O
intermediate	B-Application
representation	I-Application
.	O
</s>
<s>
For	O
instance	O
,	O
radare2	B-Language
is	O
a	O
toolbox	O
for	O
binary	O
files	O
analysis	O
and	O
reverse-engineering	O
.	O
</s>
<s>
It	O
uses	O
the	O
intermediate	B-Application
languages	I-Application
ESIL	O
and	O
REIL	O
to	O
analyze	O
binary	O
files	O
.	O
</s>
