[PATCH] D27324: IPO: Introduce ThinLTOBitcodeWriter pass.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 12:30:20 PST 2016


pcc added a comment.

In https://reviews.llvm.org/D27324#612128, @tejohnson wrote:

> In https://reviews.llvm.org/D27324#612037, @pcc wrote:
>
> > In https://reviews.llvm.org/D27324#612009, @mehdi_amini wrote:
> >
> > > Another high-level comment: technically I don't think we need to split anything for type-based LTO devirtualization.
> >
> >
> > It may be possible to implement vcall opt without splitting, but it certainly seems a lot more complicated. For example virtual const prop works by "evaluating" each virtual function; we'd somehow need to figure out which virtual functions can be evaluated and store the values in the summary.
>
>
> I haven't thought through this, but is it possible to evaluate the virtual functions at compile time (without WPA)? I.e. is the issue deciding which virtual functions can be evaluated, doing the evaluation, or how to store that in the summary?


I think it's more doing the evaluation. Basically we support virtual const prop on functions which take arguments that are constant at the call site. Currently this works by scanning the module for calls and evaluating the function for each set of constant arguments that are actually passed. To make this work on a whole program basis we'd either need to evaluate functions with every possible set of arguments (probably too expensive in non-trivial cases) or somehow encode the function body in the "summary" (which at that point wouldn't really be a summary at all).


https://reviews.llvm.org/D27324





More information about the llvm-commits mailing list