[PATCH] D138552: [docs] Document that the modules can improve the linking time

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 25 12:25:26 PST 2022


dblaikie added a comment.

> And another problem here is, without LTO, the function definitions in other TU can't be inlined. But now, the function definitions in the module interface can be imported to the importee as AvaialableExternally linkage with optimization. The AvaialableExternally linkage is a special linkage which aims for the IPO. And the AvaialableExternally entities would be removed in the middle end after inlining. (I know there are arguments to remove the function definition in the module file.) So if we move not directly used things in .cpp files, the performance will be hurt. But it is not the case for modules (at least for now).

Yeah, I think if we're planning to minimize pcms to the point where they can't do code generation I guess we'll probably remove the indirect function definitions/not use available externally, and rely on (Thin)LTO to provide whole program optimization - so the guidance that modules reduces link time wouldn't be true in that case.

I think it's probably best to abandon this patch/not document/suggest that this is a benefit people should expect from modules if it's one that'd go away in the future anyway.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138552



More information about the cfe-commits mailing list