[clang] [CodeGen] Disable exact dynamic_cast for duplicable vtables (PR #205929)
Akira Hatanaka via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 25 15:53:58 PDT 2026
ahatanak wrote:
` !AssumeUniqueVTable` disables the optimization unconditionally, including for classes with key functions. A key-function class vtable has one strong definition, so it does have a unique address.
Also, it's not clear to me what ` !AssumeUniqueVTable` means. `AssumeUniqueVTable` means "assume a class has only one vtable", and that's used by the dynamic_cast optimization to determine whether it's safe to perform the optimization. Its negation only tells the optimizer not to rely on vtable uniqueness. I don't think it also means the platform allows emitting vtables in different linkage units and therefore vtables can be annotated with `unnamed_addr` (see https://github.com/llvm/llvm-project/pull/205930).
https://github.com/llvm/llvm-project/pull/205929
More information about the cfe-commits
mailing list