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

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 27 12:03:17 PDT 2021


ABataev added a comment.

In D108826#2969677 <https://reviews.llvm.org/D108826#2969677>, @spatel wrote:

> 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.

Do I understand correctly that your patch just reorders passes? Because I need a bit different. We need to run SLP only for the widest possible VF at compile time and run SLP at full (for all possible VFs) only at link time.
Early optimization using small VF may affect other passes(alias analysis, loads/stores/allocas elimination, Loop Vectorization, SLP itself, etc.) and we need to run SLP at full only at link time.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108826



More information about the llvm-commits mailing list