[PATCH] D91682: [LoopInterchange] Fix the checking of tightly nested loop

Geng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 23:03:16 PST 2020


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

In the loop interchange pass, when checking if the loops are tightly(perfectly) nested,  the checking of the latches are missed. This patch is supposed to use the LoopNestAnalysis to check if the loops are perfectly nested. In order to apply the LoopNestAnalysis on LoopInterchange, we did following modifications:

1. Remove the restriction that if we can not get the outer loop bound, then the loops are not perfectly nested.
2. Add the case when outer header branches to inner preheader which do not violate the perfectly nested property.
3. Add the case when InnerLoopExit equals to the OuterLoopLatch, which do not violate the perfectly nested property.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91682

Files:
  llvm/lib/Analysis/LoopNestAnalysis.cpp
  llvm/lib/Transforms/Scalar/LoopInterchange.cpp
  llvm/test/Transforms/LoopInterchange/perfectly-nested.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91682.305982.patch
Type: text/x-patch
Size: 12337 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201118/35cce53f/attachment.bin>


More information about the llvm-commits mailing list