[all-commits] [llvm/llvm-project] 8adfa2: [Pipelines] Introduce SROA after (final, run-time)...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Thu Nov 17 10:35:47 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8adfa29706e5407b62a4726e2172894e0dfdc1e8
      https://github.com/llvm/llvm-project/commit/8adfa29706e5407b62a4726e2172894e0dfdc1e8
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

  Changed paths:
    M clang/test/CodeGen/cleanup-destslot-simple.c
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    M llvm/test/Other/new-pm-defaults.ll
    M llvm/test/Other/new-pm-lto-defaults.ll
    M llvm/test/Other/new-pm-thinlto-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
    M llvm/test/Transforms/Coroutines/coro-retcon-resume-values.ll
    M llvm/test/Transforms/PhaseOrdering/X86/SROA-after-final-loop-unrolling-2.ll
    M llvm/test/Transforms/PhaseOrdering/X86/SROA-after-final-loop-unrolling.ll
    M llvm/test/Transforms/PhaseOrdering/single-iteration-loop-sroa.ll

  Log Message:
  -----------
  [Pipelines] Introduce SROA after (final, run-time) loop unrolling

Now that we are done with loop unrolling, be it either by LoopVectorizer,
or LoopUnroll passes, some variable-offset GEP's into alloca's could have
become constant-offset, thus enabling SROA and alloca promotion,
yet we don't capitalize on that, which is surprizing.

While it would be good to not introduce one more SROA invocation,
but instead move the one from `PassBuilder::buildFunctionSimplificationPipeline()`,
the existing test coverage says that is a bad idea,
though it would be fine compile-time wise: https://llvm-compile-time-tracker.com/compare.php?from=b150d34c47efbd8fa09604bce805c0920360f8d7&to=5a9a5c855158b482552be8c7af3e73d67fa44805&stat=instructions

So instead, i add yet another SROA run.
I have checked, and it needs to be at least after said final loop unrolling.
This is still fine compile-time wise: https://llvm-compile-time-tracker.com/compare.php?from=70324cd88328c0924e605fa81b696572560aa5c9&to=fb489bbef687ad821c3173a931709f9cad9aee8a&stat=instructions

I've encountered this in a real code, `SROA-after-final-loop-unrolling.ll` has been reduced from https://godbolt.org/z/fsdMhETh3

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D136806




More information about the All-commits mailing list