Polly Polyhedral Optimizations for LLVM
Tobias Grosser - Hongbin Zheng - Raghesh Aloor Andreas Simb¨ urger - Armin Gr¨
- sslinger - Louis-No¨
el Pouchet April 03, 2011
Polly - Polyhedral Optimizations for LLVM April 03, 2011 1 / 27
Polly Polyhedral Optimizations for LLVM Tobias Grosser - Hongbin - - PowerPoint PPT Presentation
Polly Polyhedral Optimizations for LLVM Tobias Grosser - Hongbin Zheng - Raghesh Aloor Andreas Simb urger - Armin Gr osslinger - Louis-No el Pouchet April 03, 2011 Polly - Polyhedral Optimizations for LLVM April 03, 2011 1 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 1 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 2 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 3 / 27
◮ SSA, Register Machine ◮ Language and Target Independent ◮ Integrated SIMD Support
Polly - Polyhedral Optimizations for LLVM April 03, 2011 4 / 27
◮ clang → C/C++/Objective-C ◮ Mono → .Net ◮ OpenJDK → Java ◮ dragonegg → C/C++/Fortran/ADA/Go ◮ Others → Ruby/Python/Lua
◮ ActionScript (Adobe) ◮ Google Native Client
Polly - Polyhedral Optimizations for LLVM April 03, 2011 5 / 27
LLVM IR LLVM IR
PSCoP
SCoP Detection & LLVM to Poly Code Generation SIMD Backend OpenMP Backend JSCoP Import/Export * Classical loop transformations (Blocking, Interchange, Fusion, ...) * Expose parallelism * Dead instruction elimination / Constant propagation
Manual Optimization / LooPo / Pluto / PoCC+Pluto / ... Dependency Analysis PTX Backend
Polly - Polyhedral Optimizations for LLVM April 03, 2011 6 / 27
◮ Regular for loops ◮ Conditions
◮ Loop bounds, conditions, access functions
Polly - Polyhedral Optimizations for LLVM April 03, 2011 7 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 8 / 27
◮ Regular for loops → Anything that acts like a regular for loop ◮ Conditions
Polly - Polyhedral Optimizations for LLVM April 03, 2011 9 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 10 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 11 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 12 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 13 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 14 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 15 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 16 / 27
◮ OpenMP, if loop ⋆ is parallel ⋆ is not surrounded by any other parallel loop ◮ Efficient SIMD instructions, if loop ⋆ is innermost ⋆ is parallel ⋆ has constant number of iterations Polly - Polyhedral Optimizations for LLVM April 03, 2011 17 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 18 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 19 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 20 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 21 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 22 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 23 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 24 / 27
LLVM IR LLVM IR
PSCoP
SCoP Detection & LLVM to Poly Code Generation SIMD Backend OpenMP Backend JSCoP Import/Export * Classical loop transformations (Blocking, Interchange, Fusion, ...) * Expose parallelism * Dead instruction elimination / Constant propagation
Manual Optimization / LooPo / Pluto / PoCC+Pluto / ... Dependency Analysis Usable for experiments Planned Under Construction PTX Backend
Polly - Polyhedral Optimizations for LLVM April 03, 2011 25 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 26 / 27
Polly - Polyhedral Optimizations for LLVM April 03, 2011 27 / 27