[PATCH] D152741: [WPD] implement -fskip-vtable-filepaths

Teresa Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 13 13:02:59 PDT 2023


tejohnson added a comment.

I think I understand the motivation, but not sure I agree this is the right approach - can you simply not pass -flto-unit and -fwhole-program-vtables for these files?

Also, isn't this hiding possibly necessary info from WPD that might be needed for correct class hierarchy analysis affecting other IR modules? I.e. in the type-metadata-skip-vtable-filepaths.cpp test, what if A was derived from a struct B, which was also defined/used in another module without this skipping option. We would lose information about the override of f in A, and possibly do an incorrect devirtualization elsewhere. It seems like a dangerous option to provide.

It might be better to provide an option that can somehow mark vtables in a given module as unsafe for devirt, and propagate that info to WPD.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152741



More information about the cfe-commits mailing list