[PATCH] D136806: [Pipelines] Introduce SROA after (full) loop unrolling

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 17:53:05 PDT 2022


lebedev.ri created this revision.
lebedev.ri added reviewers: aeubanks, fhahn, nikic, spatel, MaskRay, asbirlea.
lebedev.ri added a project: LLVM.
Herald added subscribers: ormris, StephenFan, wenlei, steven_wu, zzheng, hiraditya.
Herald added a project: All.
lebedev.ri requested review of this revision.

I am surprised that we didn't do this already.

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 full loop unrolling,
but i suppose placing it after InstCombine does not hurt.
Surprisingly, this is still fine compile-time wise: https://llvm-compile-time-tracker.com/compare.php?from=70324cd88328c0924e605fa81b696572560aa5c9&to=fb489bbef687ad821c3173a931709f9cad9aee8a&stat=instructions

Now, something in that link makes me cringe.
Compare it with https://llvm-compile-time-tracker.com/compare.php?from=70324cd88328c0924e605fa81b696572560aa5c9&to=d534377c0324a63ac26b990967577562e28a148f&stat=instructions
Those two commits share base, and don't functionally differ,
yet that `+0.23%` 'regression' is there in one of them.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136806

Files:
  llvm/lib/Passes/PassBuilderPipelines.cpp
  llvm/test/Other/new-pm-defaults.ll
  llvm/test/Other/new-pm-lto-defaults.ll
  llvm/test/Other/new-pm-thinlto-defaults.ll
  llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
  llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
  llvm/test/Transforms/Coroutines/coro-retcon-resume-values.ll
  llvm/test/Transforms/PhaseOrdering/X86/SROA-after-final-loop-unrolling.ll
  llvm/test/Transforms/PhaseOrdering/single-iteration-loop-sroa.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136806.470979.patch
Type: text/x-patch
Size: 13866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221027/7416c2ce/attachment.bin>


More information about the llvm-commits mailing list