~/talk

“My Little Optimizer: Undefined Behavior is Magic"

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

Modern C++ compilers treat undefined behavior as permission to change code: LLVM turns a load-from-null into unreachable and removes the preceding store, collapses uninitialized values via undef folding, and uses the NSW flag for signed overflow to simplify arithmetic and loop bounds. Strict-aliasing and lifetime markers let stores be eliminated, malloc’s noalias on malloc enables load-forwarding, and atomics can be optimized under the standard’s ordering rules. Use UBSan, sanitizers and fuzzing to find these bugs before optimizations hide them.

AI-written summary · about

  1. 0:00Introduction to UB
  2. 3:21Representing UB in LLVM
  3. 10:00Control flow and lifetimes
  4. 14:25Null pointers and aliasing
  5. 16:43Signed vs unsigned arithmetic
  6. 25:57Memory models and realloc
  7. 29:44Atomic and thread consistency
  8. 33:47Mitigation and standards
  9. 39: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.