[libc++abi] Improve performance of __dynamic_cast
authorSirui Mu <msrlancern@gmail.com>
Sun, 19 Mar 2023 09:03:38 +0000 (10:03 +0100)
committerNikolas Klauser <nikolasklauser@berlin.de>
Sun, 19 Mar 2023 09:04:34 +0000 (10:04 +0100)
commitc9d475c937d2dc7e72ffa78acebaac3f6a2b5015
treec1ac1dc2014c758e387578e3cc905d73b9669d75
parent8510cf9fc1a431b70737b2b046007d318c62b7a8
[libc++abi] Improve performance of __dynamic_cast

The original `__dynamic_cast` implementation does not use the ABI-provided `src2dst_offset` parameter which helps improve performance on the hot paths. This patch improves the performance on the hot paths in `__dynamic_cast` by leveraging hints provided by the `src2dst_offset` parameter. This patch also includes a performance benchmark suite for the `__dynamic_cast` implementation.

Reviewed By: philnik, ldionne, #libc, #libc_abi, avogelsgesang

Spies: mikhail.ramalho, avogelsgesang, xingxue, libcxx-commits

Differential Revision: https://reviews.llvm.org/D138005
libcxx/benchmarks/CMakeLists.txt
libcxx/benchmarks/libcxxabi/dynamic_cast.bench.cpp [new file with mode: 0644]
libcxx/docs/ReleaseNotes.rst
libcxxabi/src/private_typeinfo.cpp