Skip to content
0:00 / 0:00

#llvm#clang#compileroptimization

Understanding Compiler Optimization - Chandler Carruth - Opening Keynote Meeting C++ 2015

Meeting Cpp

38K subscribers • 32 videos on Hallway • Conference channel

YouTube
  • Recommended by 3 people: 1 on Lobsters and 2 curated lists.
  • Presented by Chandler Carruth

Advanced. Deep dive for people who know the field.

146K views10 years ago3 recommendations

Systems programmingProgramming languagesCompilers and interpretersC++Performance and optimization

Chandler Carruth explains how modern compilers optimize C++ code, focusing on LLVM and Clang internals.

Understanding Compiler Optimization Chandler Carruth Opening Keynote Meeting C++ 2015 Slides: meetingcpp.com/files/mcpp/2015/talks/meetingcxx_2015-underst…

Why it's here

3 people recommend this

What people say. Highly recommended as an essential resource for understanding compiler optimizations and C++ performance.

Moments people linked to

programming-talkscurated list on GitHubRecommends

Under “Compilers/Interpreters”

Understanding Compiler Optimizations 01:50:14 by **Chandler Carruth** (2015)

Coding Interview Universitycurated list on GitHubRecommends

Under “Additional Learning”

Understanding Compiler Optimization (C++) (video)

riveron Lobsters • Recommends

Understanding LLVM C++ Compiler Optimization - Chandler Carruth

u/skeetoin r/C_Programming • Mentions

On “Is using pointers and dereferencing slower than using non-pointer variables?”

The performance hit isn't from the actual dereferencing, but rather that unnecessary references prevent important optimizations, especially loop vectorization. Pointers are often permitted to *alias* one another, and compilers must handle the situation even if you never intend for that to happen. This requires extra loads and stores, and creates false loop-carried dependencies. As a result, value semantics and copying can be a lot faster simply because it doesn't inhibit optimizations. Related talks: * Understanding Compiler Optimization * Optimizing the Emergent Structures of C++

u/skeetoin r/C_Programming • Mentions

On “Why is there no C conference?”

Every year you can think of a subset of CppCon as being like a C conference. There are a bunch of presentations that are entirely or mostly relevant to C, and not just in a broader sense of being relevant to *any* language. I plucked out a bunch from CppCon 2017 for you. These are *roughly* ordered from best to worst: * [Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid”] * Chandler Carruth “Going Nowhere Faster” * James McNellis “Everything You Ever Wanted to Know about DLLs” * John Regehr “Undefined Behavior in 2017 (part 1 of 2)” * John Regehr “Undefined Behavior in 2017 (part 2 of 2)” * Piotr Padlewski “Undefined Behaviour is awesome!” * [Tob…

u/MrB92in r/C_Programming • Mentions

On “What is the difference between a function returning a value and a function writing to a variable?”

Pretty much this. Because the possibility of pointer aliasing exists, compilers can often miss out on many optimizations because it can make way less assumptions. So output parameters like these may generate worse code and should be avoided when possible. You don't have to believe me, here's a related talk from a guy who works at Google with LLVM (who explains it way better than I can) link to this video
6View on Reddit

u/twbmspin r/compsci • Mentions

On “Recommandations of relatively advanced/useful documentaries/YT talks/lectures (roughly ~60min or more) of CS to watch?”

Graph Isomorphism in Quasipolynomial Time I - László Babai Graph Isomorphism in Quasipolynomial Time II - László Babai Less technical (but still) : Understanding Compiler Optimization - Chandler Carruth

u/Dense-Buttonin r/ProgrammingLanguages • Mentions

On “If all compiled languages compile to machine code then why some languages run faster than others?”

If you liked the site, you'll love this talk by Matt godbolt (the guy who made the site) link to this video And also there's another talk by Chandler carruth that goes into details about how compilers optimize code link to this video

u/the_d3f4ultin r/C_Programming • Mentions

On “Is passing structs like this bad practice?”

besides much better optimizations You gain reduced complexity, due to the fact that (for example) you don't need to deal with memory ownership. You don't need to consider who or when will free or allocate the memory. There is generally much less to think about. You can freely mutate it. You don't need to consider many things you otherwise would. It is safer, because you don't need to consider edge cases.. Like, what if the pointer is null, or it is shared among other threads. Nothing unexpected like that can happen when you pass by value. That safeness also reduces complexity. You don't need to check if the value is null. If you called into an external library, the pointer returned mi…