[all-commits] [llvm/llvm-project] df9158: [LoopInterchange] Replace tightly-nesting-ness che...

Ta-Wei Tu via All-commits all-commits at lists.llvm.org
Sun Mar 7 19:36:26 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: df9158c9a45a6902c2b0394f9bd6512e3e441f31
      https://github.com/llvm/llvm-project/commit/df9158c9a45a6902c2b0394f9bd6512e3e441f31
  Author: Ta-Wei Tu <tu.da.wei at gmail.com>
  Date:   2021-03-08 (Mon, 08 Mar 2021)

  Changed paths:
    M llvm/include/llvm/Analysis/LoopNestAnalysis.h
    M llvm/lib/Analysis/LoopNestAnalysis.cpp
    M llvm/lib/Transforms/Scalar/LoopInterchange.cpp
    A llvm/test/Transforms/LoopInterchange/pr48113.ll

  Log Message:
  -----------
  [LoopInterchange] Replace tightly-nesting-ness check with the one from `LoopNest`

The check `tightlyNested()` in `LoopInterchange` is similar to the one in `LoopNest`.
In fact, the former misses some cases where loop-interchange is not feasible and results in incorrect behaviour.
Replacing it with the much robust version provided by `LoopNest` reduces code duplications and fixes https://bugs.llvm.org/show_bug.cgi?id=48113.

`LoopInterchange` has a weaker definition of tightly or perfectly nesting-ness than the one implemented in `LoopNest::arePerfectlyNested()`.
Therefore, `tightlyNested()` is instead implemented with `LoopNest::checkLoopsStructure` and additional checks for unsafe instructions.

Reviewed By: Whitney

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




More information about the All-commits mailing list