
CppCon 2017: Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid”
About this video
Matt Godbolt's CppCon 2017 talk shows what modern compilers do with your C++ code, using Compiler Explorer to inspect generated assembly. It covers surprising optimizations and how the tool works.
Why it appears in the archive
HN recommends it as an entertaining, mind-blowing look at compiler cleverness from a great speaker.
AI-generated summary and labels from the source dataset; verify important details against the video. Source & credits.
From the Hacker News discussion
Matt Godbolt is a great speaker as well. I loved this talk that included a bit about the architecture behind his Compiler Explorer. The rest of his talk is super cool as well. E.g. closed form solutions from O(n) code? Compilers are awesome. [VIDEO]
Read original comment ↗I highly recommend Matt Godbolt's talk "What has my compiler done for me lately?"[0] and its follow-up[1]. Both are great presentations going into details on some of the crazy optimizations compilers will do. As someone who knows very little about the inner workings of compilers my mind was blown when I saw some them. [0] [VIDEO] [1] [LINK]
Read original comment ↗You should check out this presentation done by Matt Godbolt about compiler internals. He talks about what kind of optimizations are being done by GCC and Clang. Pretty amazing stuff. For example, the compiler will figure out you are trying to write a pop count in high level code and replace it with a single popcount instruction. [VIDEO]
Read original comment ↗What has my compiler done for me lately? - Matt Godbolt [VIDEO] Entertaining talk, not extremely in depth, though.
Read original comment ↗CppCon has super interesting content. That comes from a person who has written maybe two dozen lines of C++ code, mostly just hello world. E.g. this talk by Matt Godbolt or anything by Chadler Carruth. [VIDEO]
Read original comment ↗But please keep in mind that today's compilers are (most of the time) very smart. Hacker's Delight is somewhat outdated today. There's no need anymore for writing "x << 2" instead of "x * 4". I recommend Matt Godbolt's Talk(s) about compiler cleverness: [VIDEO] (see the 30 minute mark for the multiplication example)
Read original comment ↗Tangent, but this reminds me of this great talk by Matt Godbolt from CppCon 2017: “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid” [VIDEO] . And the follow up [LINK] .
Read original comment ↗Link to the (great) CppCon talk: [VIDEO] The one thing I would say is: as you dig more into C++ perf, you can develop an intuition for the kinds of things the compiler can and can't optimize. For instance, the C++ example from the article uses `std::unordered_map`, which is just an absolute mess from a cache locality perspective—the best compilers today (or of the foreseeable future) can't do a thing to fix that. Improving the programmer's choice of data structure is just not on the radar. :(
Read original comment ↗