~/talk

When C++ Zero-Cost Abstraction fails: how-to Fix Your Compiler

Talkat CppCon 2019 · 2019-09-15..09-20· [compilers-and-language-design, c-and-cpp]
links:none on file
slides:none on file

A C++ zero-cost abstraction stops LLVM from vectorizing a trivial element-wise add, causing Python-generated code to run about 45 μs vs 110 μs (C vs Python wrapper). The investigation uses clang’s -Rpass diagnostics, LLVM IR/MIR inspection, and a custom MIR registration to remove a struct-of-iterator roundtrip; the root cause is an instcombine interaction that leaves a phi node with the wrong type and is fixed via instcombine pointer typing. A reduced test case and patch restore SIMD adds and the expected speedup.

AI-written summary · about

  1. 0:00Introduction and context
  2. 2:15Vector instructions concepts
  3. 7:03LLVM IR and optimizations
  4. 11:06Analyzing the compiler bug
  5. 14:48Debugging and fixing the bug
  6. 20:16Conclusion and Q&A
~/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.