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

Ta-Wei Tu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 23 07:07:21 PST 2021


TaWeiTu created this revision.
TaWeiTu added reviewers: Whitney, fhahn.
Herald added a subscriber: hiraditya.
TaWeiTu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97290

Files:
  llvm/include/llvm/Analysis/LoopNestAnalysis.h
  llvm/lib/Analysis/LoopNestAnalysis.cpp
  llvm/lib/Transforms/Scalar/LoopInterchange.cpp
  llvm/test/Transforms/LoopInterchange/pr48113.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97290.325785.patch
Type: text/x-patch
Size: 10227 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210223/1a872e6b/attachment.bin>


More information about the llvm-commits mailing list