~/talk

“Understanding Optimizers: Helping the Compiler Help You”

Talkat CppCon 2018 · 2018-09-23..09-28· [compilers-and-language-design]
links:none on file
slides:none on file

Explains why compilers inline and when they won’t, with concrete examples: std::sort often turns a function pointer call into an indirect call but wrapping the function in a lambda usually forces inlining (GCC/Clang -O2/-O3); vector::clear can optimize away element destruction when destructors are trivial; passing bool by reference blocks hoisting and loop-specialization; reinterpret_cast of bytes is undefined and memcpy sometimes gets eliminated and sometimes not, and std::variant::visit can emit surprisingly heavy indirection. Slides and code live on the CppCon2018 GitHub link in the description.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 1:26What the talk covers
  3. 10:30Compiler constraints and basics
  4. 17:42Inlining and its importance
  5. 23:03Const propagation explained
  6. 28:06Passing by reference pitfalls
  7. 34:12Branches and optional usage
  8. 37:05Forcing compiler optimizations
  9. 39:36Sorting and function pointers
  10. 41:19Reading bytes to structs safely
  11. 47:02Variant and visitor patterns
  12. 51:01Compiler limitations and advice
  13. 52:10Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.