Open64/ORC compilers
Sébastian Pop Université Louis Pasteur Strasbourg, Project A3 INRIA FRANCE
Open64/ORC compilers – p.1
Open64/ORC compilers Sbastian Pop Universit Louis Pasteur - - PowerPoint PPT Presentation
Open64/ORC compilers Sbastian Pop Universit Louis Pasteur Strasbourg, Project A3 INRIA FRANCE Open64/ORC compilers p.1 Short history 1994: Ragnarok compiler for MIPS R8000 Open64/ORC compilers p.2 Short history 1994: Ragnarok
Sébastian Pop Université Louis Pasteur Strasbourg, Project A3 INRIA FRANCE
Open64/ORC compilers – p.1
Open64/ORC compilers – p.2
Open64/ORC compilers – p.2
Open64/ORC compilers – p.2
Open64/ORC compilers – p.2
Open64/ORC compilers – p.2
Open64/ORC compilers – p.2
Open64/ORC compilers – p.2
Compiler’s Structure – p.3
Compiler’s Structure – p.4
Compiler’s Structure – p.4
Compiler’s Structure – p.4
Compiler’s Structure – p.4
Compiler’s Structure – p.4
Compiler’s Structure – p.4
Compiler’s Structure – p.5
Compiler’s Structure – p.5
whirl2c and whirl2f dump WHIRL in compilable
whirl2a dump WHIRL in ASCII.
Compiler’s Structure – p.5
file2.cxx file3.f
Suppose that we want to build a project containing 3 files and use the IPA for
file1.c
Compiler’s Structure – p.6
file2.cxx C++ front−end file3.f F90 front−end C front−end file1.c
the right front−end. The first step invokes
Compiler’s Structure – p.6
file2.cxx C++ front−end file3.f F90 front−end WHIRL dumper C front−end file1.c
This representation is then dumped into a .o file. These .o files behave like normal relocatable code (I.e. can be put in archives, etc.)
file3.o file2.o file1.o
The compiler transforms front−end specific trees into WHIRL trees.
Compiler’s Structure – p.6
file2.cxx C++ front−end file3.f F90 front−end WHIRL dumper C front−end file1.c file1.o file2.o file3.o lib1.a
The linker is called as usual
Linker lib2.so
.a files can contain WHIRL normal .o files. trees, as well as
Compiler’s Structure – p.6
file2.cxx C++ front−end file3.f F90 front−end WHIRL dumper C front−end file1.c file1.o file2.o file3.o lib1.a
Some files contain WHIRL trees: the compilation is not complete, and the IPA is called.
Linker Inter Procedural Analysis (IPA) lib2.so
Compiler’s Structure – p.6
file2.cxx C++ front−end file3.f F90 front−end WHIRL dumper C front−end file1.c file1.o file2.o file3.o lib1.a Linker Inter Procedural Optimizations (IPO) Inter Procedural Analysis (IPA) lib2.so
Compiler’s Structure – p.6
file2.cxx C++ front−end file3.f F90 front−end WHIRL dumper C front−end file1.c file1.o file2.o file3.o lib1.a Linker Loop Nest Optimizer (LNO) Inter Procedural Optimizations (IPO) Inter Procedural Analysis (IPA) lib2.so
Compiler’s Structure – p.6
file2.cxx C++ front−end file3.f F90 front−end WHIRL dumper C front−end file1.c file1.o file2.o file3.o lib1.a Linker Loop Nest Optimizer (LNO) Inter Procedural Optimizations (IPO) Inter Procedural Analysis (IPA) Main Optimizer (WOPT) lib2.so
Compiler’s Structure – p.6
file2.cxx C++ front−end file3.f F90 front−end WHIRL dumper C front−end file1.c file1.o file2.o file3.o lib1.a Linker Code Generator (CG) Loop Nest Optimizer (LNO) Inter Procedural Optimizations (IPO) Inter Procedural Analysis (IPA) Main Optimizer (WOPT) lib2.so
Compiler’s Structure – p.6
file2.cxx C++ front−end file3.f F90 front−end WHIRL dumper C front−end file1.c file1.o file2.o file3.o lib1.a Executable file Linker Code Generator (CG) Loop Nest Optimizer (LNO) Inter Procedural Optimizations (IPO) Inter Procedural Analysis (IPA) Main Optimizer (WOPT) lib2.so
Compiler’s Structure – p.6
Compiler’s Structure – p.7
Compiler’s Structure – p.7
Compiler’s Structure – p.8
Compiler’s Structure – p.8
Compiler’s Structure – p.8
Compiler’s Structure – p.9
Compiler’s Structure – p.9
Compiler’s Structure – p.10
Compiler’s Structure – p.10
Compiler’s Structure – p.11
Compiler’s Structure – p.12
IF_COND BB1 BB2
Compiler’s Structure – p.13
IF_COND <BB1, p1> <BB2, p2>
If−conversion converts control−dependences to data−dependences replaces "if" constructs with guarded statements IF−conversion =
Compiler’s Structure – p.13
IF_COND <BB1, p1> <BB2, p2> eval (BB1) (p1) eval (BB2) (p2) (p1, p2) = eval (IF_COND)
If−conversion DAG of the CFG linearized into a single block with guarded stmts Hyperblock = converts control−dependences to data−dependences replaces "if" constructs with guarded statements IF−conversion =
Compiler’s Structure – p.13
IF ELSE THEN
4 instructions can be executed in parallel
ILP = Instruction Level Parallelism
Compiler’s Structure – p.13
IF ELSE THEN
✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✠ ✠ ✠ ✠ ✠ ✠ ✠ ✠ ✠ ✠ ✠ ✠ ✠ ✠ ✠ ✠ ✠ ✠ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ✡ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☛ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✌ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✍ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎p0 p0 p0 p0 p0 p1 p2 p1 p1 p1 p1 p2 p2 p2 p0 p0 p0 p0 p0 p0 p0 Each instruction is predicated.
Compiler’s Structure – p.13
p0 p0 p0 p0 p0 p0 p0 p0 p1 p1 p1 p1 p1 p0 p0 p0 p0 p2 p2 p2 p2 Create a hyperblock
Compiler’s Structure – p.13
Compiler’s Structure – p.14
Compiler’s Structure – p.15