[PATCH] D134606: [LAA] Change to function analysis for new PM.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 05:01:01 PDT 2022


fhahn updated this revision to Diff 464222.
fhahn marked 2 inline comments as done.
fhahn added a comment.

In D134606#3825328 <https://reviews.llvm.org/D134606#3825328>, @aeubanks wrote:

> In D134606#3824981 <https://reviews.llvm.org/D134606#3824981>, @fhahn wrote:
>
>> In D134606#3824905 <https://reviews.llvm.org/D134606#3824905>, @aeubanks wrote:
>>
>>> I looked at the repro in #50940 to see why analyses weren't getting invalidated. I think something like https://github.com/llvm/llvm-project/commit/f4c0810a79776a63fd2ba57be0199a31e35d5ad7 is more appropriate. We should be invalidating all loop analyses after a loop adaptor is finished, if any loop pass made a change. That fixes https://github.com/llvm/llvm-project/issues/50940. Thoughts on that?
>
> On principle we should never have invalid analyses that are in the cache and available for use. If a loop analysis can depend on a function analysis and that function analysis may be modified over the course of the loop pipeline, we should blow away the loop analysis. That patch blows away loop analyses as we return to a function pass manager from a loop pass manager if any loop passes have made changes.
>
> Seemingly no compile time impact:
> https://llvm-compile-time-tracker.com/compare.php?from=0cdd671df919974bed11293e37ac917cac55be64&to=f4c0810a79776a63fd2ba57be0199a31e35d5ad7&stat=instructions

Thanks for measuring this, definitely not what I would have execpted!

In D134606#3825510 <https://reviews.llvm.org/D134606#3825510>, @asbirlea wrote:

> Missed sending this earlier - thanks Arthur for figuring out why things weren't invalidated. I think that makes sense to fix anyway. Still think it makes sense to have LAA as function analysis, but also fix the invalidation.

Sounds good to me!

> Nit: remove unused include in LoopIdiomRecognize.cpp.

I think LoopIdiomRecognize uses a helper defined in LoopAccessAnalysis.h (isConsecutiveAccess)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134606

Files:
  llvm/include/llvm/Analysis/LoopAccessAnalysis.h
  llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h
  llvm/lib/Analysis/LoopAccessAnalysis.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp
  llvm/lib/Transforms/Scalar/LoopDistribute.cpp
  llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
  llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
  llvm/lib/Transforms/Utils/LoopVersioning.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.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/LoopDistribute/basic.ll
  llvm/test/Transforms/LoopDistribute/laa-invalidation.ll
  llvm/test/Transforms/LoopUnroll/unroll-loop-invalidation.ll
  llvm/test/Transforms/LoopVectorize/memory-dep-remarks.ll
  llvm/test/Transforms/LoopVectorize/novect-lcssa-cfg-invalidation.ll
  llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-markloopasdeleted.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134606.464222.patch
Type: text/x-patch
Size: 27163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220930/6b48551c/attachment-0001.bin>


More information about the llvm-commits mailing list