[all-commits] [llvm/llvm-project] 22c77f: [Polly] Use separate DT/LI/SE for outlined subfn. ...

Michael Kruse via All-commits all-commits at lists.llvm.org
Sat Aug 10 05:25:36 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 22c77f235416d137ea83875c16901fdf32b57159
      https://github.com/llvm/llvm-project/commit/22c77f235416d137ea83875c16901fdf32b57159
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2024-08-10 (Sat, 10 Aug 2024)

  Changed paths:
    M polly/include/polly/CodeGen/BlockGenerators.h
    M polly/include/polly/CodeGen/IslExprBuilder.h
    M polly/include/polly/CodeGen/IslNodeBuilder.h
    M polly/include/polly/CodeGen/LoopGenerators.h
    M polly/include/polly/CodeGen/LoopGeneratorsGOMP.h
    M polly/include/polly/CodeGen/LoopGeneratorsKMP.h
    M polly/include/polly/Support/ScopHelper.h
    M polly/lib/CodeGen/BlockGenerators.cpp
    M polly/lib/CodeGen/IslExprBuilder.cpp
    M polly/lib/CodeGen/IslNodeBuilder.cpp
    M polly/lib/CodeGen/LoopGeneratorsGOMP.cpp
    M polly/lib/CodeGen/LoopGeneratorsKMP.cpp
    M polly/lib/Support/ScopHelper.cpp

  Log Message:
  -----------
  [Polly] Use separate DT/LI/SE for outlined subfn. NFC. (#102460)

DominatorTree, LoopInfo, and ScalarEvolution are function-level analyses
that expect to be called only on instructions and basic blocks of the
function they were original created for. When Polly outlined a parallel
loop body into a separate function, it reused the same analyses seemed
to work until new checks to be added in #101198.

This patch creates new analyses for the subfunctions. GenDT, GenLI, and
GenSE now refer to the analyses of the current region of code. Outside
of an outlined function, they refer to the same analysis as used for the
SCoP, but are substituted within an outlined function.

Additionally to the cross-function queries of DT/LI/SE, we must not
create SCEVs that refer to a mix of expressions for old and generated
values. Currently, SCEVs themselves do not "remember" which
ScalarEvolution analysis they were created for, but mixing them is just
as unexpected as using DT/LI across function boundaries. Hence
`SCEVLoopAddRecRewriter` was combined into `ScopExpander`.
`SCEVLoopAddRecRewriter` only replaced induction variables but left
SCEVUnknowns to reference the old function. `SCEVParameterRewriter`
would have done so but its job was effectively superseded by
`ScopExpander`, and now also `SCEVLoopAddRecRewriter`. Some issues
persist put marked with a FIXME in the code. Changing them would
possibly cause this patch to be not NFC anymore.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list