[PATCH] D154658: Optimize emission of `dynamic_cast` to final classes.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 12 15:46:52 PDT 2023


rsmith added a comment.

In D154658#4490468 <https://reviews.llvm.org/D154658#4490468>, @rjmccall wrote:

> Oh, this does matter on platforms using pointer authentication, because each vptr field is signed with a constant discriminator derived from the name of the class that introduced it.

Oh, hm. I guess you have an out-of-tree patch for that? I've switched back to passing types into `GetVTablePtr`, and stopped using that from `emitExactDynamicCast` in favor of directly loading the vtpr after the `dynamic_cast<void*>`. You would need to disable the exact `dynamic_cast` optimization when pointer authentication is enabled for vptrs, but that should be a small patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154658/new/

https://reviews.llvm.org/D154658



More information about the cfe-commits mailing list