interface et extension de open research compiler
play

Interface et extension de Open Research Compiler S ebastian Pop - PowerPoint PPT Presentation

Interface et extension de Open Research Compiler S ebastian Pop Universit e Louis Pasteur Strasbourg, Projet A3 INRIA, FRANCE Interface et extensiondeOpen Research Compiler p.1 Prsentation gnrale L entreprise et


  1. Interface et extension de Open Research Compiler S´ ebastian Pop Universit´ e Louis Pasteur Strasbourg, Projet A3 INRIA, FRANCE Interface et extensiondeOpen Research Compiler – p.1

  2. Présentation générale L ’entreprise et l’encadrement: INRIA Rocquencourt Projet A3 Encadrement: Albert Cohen Durée: 13 semaines (du 3 juin au 30 août) Interface et extensiondeOpen Research Compiler – p.2

  3. Présentation du stage Buts du stage: Découvrir le compilateur Open64/ORC Documenter le compilateur Implémenter une passe dans le générateur de code. Interface et extensiondeOpen Research Compiler – p.3

  4. Structure du compilateur 1. FE (Front-ends) 2. WHIRL (Intermediate Representation) 3. IPA (Inter Procedural Analysis) 4. LNO (Loop Nest Optimizer) 5. WOPT (Global Optimizer) 6. CG (Code Generator) 7. ORC (Open Research Compiler) Interface et extensiondeOpen Research Compiler – p.4

  5. Front Ends Front-ends C et C++ de GCC Fortran 90 de Cray Chaque front-end a ses propres AST Traduction des AST vers WHIRL Interface et extensiondeOpen Research Compiler – p.5

  6. WHIRL Winning Hierarchical Intermediate Representation Language 5 niveaux: VH, H, M, L, VL lowering entre niveaux. Chaque optimization au bon niveau. Interface et extensiondeOpen Research Compiler – p.6

  7. Inter Procedural Analysis file1.c file2.cxx file3.f Interface et extensiondeOpen Research Compiler – p.7

  8. Inter Procedural Analysis file1.c file2.cxx file3.f C front−end C++ front−end F90 front−end Interface et extensiondeOpen Research Compiler – p.7

  9. Inter Procedural Analysis file1.c file2.cxx file3.f C front−end C++ front−end F90 front−end WHIRL dumper file1.o file2.o file3.o Interface et extensiondeOpen Research Compiler – p.7

  10. Inter Procedural Analysis file1.c file2.cxx file3.f C front−end C++ front−end F90 front−end WHIRL dumper file1.o file2.o file3.o lib1.a lib2.so Linker Interface et extensiondeOpen Research Compiler – p.7

  11. Inter Procedural Analysis file1.c file2.cxx file3.f C front−end C++ front−end F90 front−end WHIRL dumper file1.o file2.o file3.o lib1.a lib2.so Linker Inter Procedural Analysis (IPA) Interface et extensiondeOpen Research Compiler – p.7

  12. Inter Procedural Analysis file1.c file2.cxx file3.f C front−end C++ front−end F90 front−end WHIRL dumper file1.o file2.o file3.o lib1.a lib2.so Linker Inter Procedural Analysis (IPA) Inter Procedural Optimizations (IPO) Interface et extensiondeOpen Research Compiler – p.7

  13. Inter Procedural Analysis file1.c file2.cxx file3.f C front−end C++ front−end F90 front−end WHIRL dumper file1.o file2.o file3.o lib1.a lib2.so Linker Inter Procedural Analysis (IPA) Inter Procedural Optimizations (IPO) Loop Nest Optimizer (LNO) Interface et extensiondeOpen Research Compiler – p.7

  14. Inter Procedural Analysis file1.c file2.cxx file3.f C front−end C++ front−end F90 front−end WHIRL dumper file1.o file2.o file3.o lib1.a lib2.so Linker Inter Procedural Analysis (IPA) Inter Procedural Optimizations (IPO) Loop Nest Optimizer (LNO) Main Optimizer (WOPT) Interface et extensiondeOpen Research Compiler – p.7

  15. Inter Procedural Analysis file1.c file2.cxx file3.f C front−end C++ front−end F90 front−end WHIRL dumper file1.o file2.o file3.o lib1.a lib2.so Linker Inter Procedural Analysis (IPA) Inter Procedural Optimizations (IPO) Loop Nest Optimizer (LNO) Main Optimizer (WOPT) Code Generator (CG) Interface et extensiondeOpen Research Compiler – p.7

  16. Inter Procedural Analysis file1.c file2.cxx file3.f C front−end C++ front−end F90 front−end WHIRL dumper file1.o file2.o file3.o lib1.a lib2.so Linker Inter Procedural Analysis (IPA) Inter Procedural Optimizations (IPO) Loop Nest Optimizer (LNO) Main Optimizer (WOPT) Code Generator (CG) Executable file Interface et extensiondeOpen Research Compiler – p.7

  17. Inter Procedural Analysis Rassembler l’information sur l’ensemble du projet. Interface et extensiondeOpen Research Compiler – p.8

  18. Inter Procedural Analysis Rassembler l’information sur l’ensemble du projet. Solution: sauver la WHIRL dans les .o reconstruire un AST global Interface et extensiondeOpen Research Compiler – p.8

  19. Loop Nest Optimizer LNO travaille sur le High level WHIRL . Interface et extensiondeOpen Research Compiler – p.9

  20. Loop Nest Optimizer Représentations intermédiaires spécifiques: Array Dependence Graph LEGO: for data distributions Array and vectors accesses Vector space Systems of equations Polytopes Interface et extensiondeOpen Research Compiler – p.9

  21. Loop Nest Optimizer Quelques optimiseurs du LNO: Loop unrolling Hoist conditionals Hoist varying lower bounds Dead store eliminate arrays Loop reversal / fission / fusion / tiling Array scalarization Prefetch Inter iteration Common Subexpression Elimination Interface et extensiondeOpen Research Compiler – p.9

  22. Loop Nest Optimizer Lnoptimizer [LNO_Run_Lego] LWN_Parentize Lego_PU_Init Lego_Read_Pragmas Lego_Fix_Local Lego_Fix_IO Tree nodes linked to their parent [ Run_autopar and LNO_enabled ] LNO_Build_Access IPA_LNO_Map_Calls [ LNO_Run_Lego and [ LNO_Full_Unrolling_Limit != 0 ] not LNO_enabled ] Fully_Unroll_Short_Loops Get rid of [Roundoff_Level >= ROUNDOFF_ASSOC] inconsistent control flow Build Scalar Reductions REDUCTION_MANAGER Lego_OZero_Driver [LNO_Opt > 0] Eliminate_Dead_SCF Hoist_Conditionals [not LNO_enabled and Run_autopar] Conditionals Build_Array_Dependence_Graph Parallel_And_Padding_Phase moved outside loops Hoist_Varying_Lower_Bounds Dead_Store_Eliminate_Arrays [Roundoff_Level >= ROUNDOFF_ASSOC] Array_Substitution Array Reductions Reverse_Loops Eliminate_Zero_Mult [LNO_Sclrze] Scalarize_Arrays [Run_autopar] Mark_Auto_Parallelizable_Loops Process_Pragmas Canonicalize_Unsigned_Loops [Run_autopar] Perform_ARA_and_Parallelization [LNO_Run_Lego] Lego_Skew_Indices Lego_Compute_Tile_Peel Lego_Tile [LNO_Run_Lego] Lego_Interchange Lego_Peel Fission Fusion [LNO_Sclrze] Prefetch_Driver Scalarize_Arrays [LNO_Aequiv] Equivalence_Arrays [TT_LNO_GUARD] [LNO_Minvar] Guard_Dos Minvariant_Removal Return point [LNO_Cse] Build_CG_Dependence_Graph Inter_Iteration_Cses [LNO_Run_Lego] Lego_Lower_Pragmas WN_Simplify_Tree Interface et extensiondeOpen Research Compiler – p.9

  23. Global Optimizer WOPT travaille sur le Medium-level WHIRL . Interface et extensiondeOpen Research Compiler – p.10

  24. Global Optimizer Principales représentations intermédiaires: CFG (Control Flow Graph) SSA (Static Single Assignement) Quelques optimiseurs: SSA-PRE (Partial Redundancy Elimination) DCE (Dead Code Elimination) IVR (Induction Variable Recognition) VNFRE (Value Numbering based Full Redundancy Elimination) Copy propagation Interface et extensiondeOpen Research Compiler – p.10

Recommend


More recommend