Skip to content
0:00 / 0:00

#llvm#loopoptimization#compilerpasses

2019 LLVM Developers’ Meeting: “Writing Loop Optimizations in LLVM”

LLVM

18K subscribers • 23 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Kit Barton, Ettore Tiotto, Hal Finkel, Michael Kruse, Johannes Doerfert

Advanced. Deep dive for people who know the field.

7K views6 years ago2 recommendations

Systems programmingProgramming languagesCompilers and interpretersPerformance and optimization

LLVM developers introduce loop terminology and demonstrate how to write loop optimization passes using LLVM's infrastructure.

llvm.org/devmtg/2019-10/ — Writing Loop Optimizations in LLVM - Kit Barton, Ettore Tiotto, Hal Finkel, Michael Kruse, Johannes Doerfert Slides: Coming Soon — LLVM contains an evolving set of classes and tools specifically designed to interact with loops. The Loop and LoopInfo classes are being continually improved, as are supporting data structures such as the Data Dependence Graph (DDG) and Program Dependence Graph (PDG). The pass manager infrastructure (both New and Legacy pass managers) provide infrastructure to write both function passes and loop passes. However, putting all of these concepts together to write a functioning loop optimization pass can still be a somewhat daunting task. This tutorial will start by introducing basic terminology that is used within LLVM to describe loops (for example, many of the concepts introduced in reviews.llvm.org/D65164). It will then look at the Loop and LoopInfo classes, and go over the interfaces they have to work with loops. It will provide examples of how these classes can be used to implement different types of loop optimizations, using examples from both the Loop Fusion and Loop Distribution passes. It will discuss the differences between a function pass and a loop pass, including a discussion of the advantages and disadvantages of each one when writing loop optimizations. It will also provide guidance on when each type of pass should be used. Finally, it will go through many of the useful utility functions that need to be used in order to write a loop optimization efficiently (e.g., updating the dominator tree, updating Scalar Evolution, etc.). — Videos Filmed & Edited by Bash Films: BashFilms.com

Why it's here

2 people recommend this

What people say. Recommended as a fundamental tutorial for learning how to write code optimizers and loop passes in LLVM.

u/abionicin r/ProgrammingLanguages • Recommends

On “Resources on making a code optimizer”

First thing that I remembered matching your need is this Loop Optimization in LLVM talk, mainly due to its fundamental nature link to this video

u/codetrotterin r/rust • Recommends

On “rustc/llvm lowkey blew my mind with what it did to this nested loop”

Good link, thanks! I'm currently watching a video on YouTube titled: 2019 LLVM Developers’ Meeting: “Writing Loop Optimizations in LLVM”. Link: link to this video Others who are interested in this topic might want to watch this video too. I've watched about 43 minutes of it so far and they are giving an overview of loop optimizations in LLVM with some slides and graphs, and later on they dove into code and started showing how a loop optimization for llvm can be implemented, going step by step and showing the types of things one has to be aware of when doing so. The code for that part of the talk is at https://github.com/kitbarton/LLVMLoopOptTutorial