~/talk

Link-Time Optimization of Dynamic Casts in C++ Programs

Talkat PLDI 2025 · 2025-06-16..06-20· [c-and-cpp]
name:Xufan Lu
links:none on file
links:none on file
slides:none on file

Link-time pass turns library dynamic_cast calls into short instruction sequences by laying out classes in preorder layout bounds checks, replacing linear DFS cast work with constant-time lower/upper bound comparisons, and drops unused RTTI by pruning RTTI vtable slots via liveness analysis. Prototype is an LLVM LTO pass evaluated on a ~50M‑LOC benchmark suite: average runtime improves ~1.4% and binaries shrink ~1.7%, with up to ~5% speedup (Solidity) and >4% size cut (Envoy). Replacing LLVM’s custom RTTI showed a 350% slowdown that the pass reduces to ~5%.

AI-written summary · about

  1. 0:00Dynamic casts and RTTI overhead
  2. 3:55RTTI and dynamic casts problems
  3. 6:29Traditional optimization limits
  4. 7:58Link-time optimization for dynamic casts
  5. 10:49Evaluation setup and benchmarks
  6. 12:38Case study: LLVM dynamic casts
  7. 14:24Key takeaways and zero-overhead
  8. 15:27Q&A: Shared libraries
  9. 16:53Q&A: Cast distance
  10. 19:23Q&A: LTO compile-time cost
~/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.