[PATCH] D55153: [ThinLTO] Implement index-based WPD

Sylvain Audi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 22 12:30:52 PDT 2020


saudi added a comment.

>> Our project is built clang-cl, with options `-flto=thin` and `-Xclang -fwhole-program-vtables`, andl links with pre-compiled libs that are built with MSVC. 
>>  Without `-fwhole-program-vtables` the bug disappears.
> 
> Are you building with -fno-split-lto-unit? If not, you are getting hybrid regular/Thin LTO devirtualization, and this patch doesn't really apply. By default with -fwhole-program-vtables and -flto=thin, the LTO units are split into regular and thin portions, and all vtables are in the regular portion. This patch simply extended WPD to work without splitting, hence ThinLTO "index only" - i.e. no regular LTO and no IR, and only kicks in with -fno-split-lto-unit on top of the other options. The original hybrid ThinLTO WPD was implemented by @pcc, who may have some ideas as well.

I was not using -fno-split-lto-unit option; however it was unwantedly infered by the use of `-Xclang` before `-fwhole_program_vtables` : the driver didn't see the `-fwhole_program_vtables` and hence didn't activate `-fsplit-lto-unit` on cc1 argument.
This peculiar setup seems to have been hiding my problem until this patch.
Removing the -Xclang, I could repro the bug on previous commits.
I'm investigating that now.

Thank you for your time!


Repository:
  rL LLVM

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

https://reviews.llvm.org/D55153





More information about the llvm-commits mailing list