TGViewer
Блог* Блог* @dereference_pointer_there · 1.98K subscribers
Post #11145 844
#prog #article

Exploiting Undefined Behavior in C/C++ Programs for Optimization: A Study on the Performance Impact

We presented the first comprehensive study on the performance impact of exploiting undefined behavior (UB) in C and C++ programs. First, we cataloged 18 individual UB aspects exploited by LLVM, a compiler that is widely known for its extensive use of UB. We then implemented flags in the compiler that disable exploitation of each UB aspect by strengthening the semantics (e.g., define division by zero as a well-defined trap instead of UB).
The results show that, in the cases we evaluated, the performance gains from exploiting UB are minimal [выделение моё]. Furthermore, in the cases where performance regresses, it can often be recovered by either small to moderate changes to the compiler or by using link-time optimizations
  • 🔥 5
  • 🤔 3
  • 💩 1
More from @dereference_pointer_there
  1. Sep 29, 2026#prog #rust #article Rewriting an entire UI in Rust (С Tauri на Iced) So. Was it worth it?…
  2. Sep 29, 2026#prog #rust #rustlib Fearless SIMD v1.0 is here fearless_simd takes unsafe out of SIMD.
  3. Sep 28, 2026Покраденное но прекрасное
  4. Sep 28, 2026Игру также портировали на Android
  5. Sep 28, 2026Source (без редактирования)
  6. Sep 27, 2026photo post
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →