[PATCH] D108826: [SLP][LTO][WIP]Allow full SLP in LTO only at link time.

Sanjay Patel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 27 11:46:28 PDT 2021


spatel added a comment.

In D108826#2969604 <https://reviews.llvm.org/D108826#2969604>, @ABataev wrote:

> In D108826#2969594 <https://reviews.llvm.org/D108826#2969594>, @lebedev.ri wrote:
>
>> Aha, so full lto. That is consistent with the phase ordering dilemma @spatel discovered: D102002 <https://reviews.llvm.org/D102002>
>
> Aha, do I understand correctly that he tries to add a flag(s) that we have a compile without LTO, compile at LTO and link at LTO? Or something else? Or he just tries to reorder passes depending whether we're in LTO or not in LTO?

We found that there were differences between regular and LTO for the passes invoked, their orderings, and parameters used to enable extra optimizations. (There was also inconsistency between new and old pass manager, but we can probably just focus on NPM now.)
I suspect that almost none of those differences were intentional - people just made changes for whatever pipeline they were interested in at the time and didn't realize there was divergence.
So we now have things refactored with this note:

  /// TODO: Should LTO cause any differences to this set of passes?
  void PassBuilder::addVectorPasses(OptimizationLevel Level,
                                    FunctionPassManager &FPM, bool IsFullLTO) {

So if there really is a reason for something to be different with LTO, it's set up to make that easily visible at least. :)
I made a couple of small fixes in there already, but basically any place where we do something differently for FullLTO should be investigated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108826



More information about the cfe-commits mailing list