[clang] [llvm] [WPD] Support speculative devirtualization with LTO (PR #233380)

Teresa Johnson via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 10 11:58:55 PST 2026


================

----------------
teresajohnson wrote:

markDevirt() should not be called when the call site was only conditionally devirtualized (speculative, and while we're here also -wholeprogramdevirt-check=fallback). It sets AllCallSitesDevirted, which makes the export phase skip FS->addTypeTest(GUID) for the type.checked.load users of this slot, which is going to cause issues with CFI (that uses hybrid ThinLTO and will still have a type test on the indirect fallback and needs a resolution otherwise speculation misses will trap). Suggest if (!HasPublicTarget && DevirtCheckMode != WPDCheckMode::Fallback) CSInfo.markDevirt(); plus a -wholeprogramdevirt-summary-action=export RUN line in speculative-devirt-cfi.ll checking that TypeTests: still lists the type id (Inputs/export.yaml exists for this).

https://github.com/llvm/llvm-project/pull/233380


More information about the cfe-commits mailing list