[PATCH] D86133: [LoopNest] False negative of `when LCSSA pass

Ta-Wei Tu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 04:24:44 PDT 2020


TaWeiTu created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
TaWeiTu requested review of this revision.

The LCSSA pass (required for all loop passes) sometimes adds additional blocks containing LCSSA variables, and `checkLoopsStructure` may return `false` even when the loops are perfectly nested in this case.
This is because the successor of the exit block of the inner loop now points to the LCSSA block instead of the latch block of the outer loop.
Examples are shown in the test `nests-with-lcssa.ll`.

To fix the issue, the successor of the exit block of the inner loop can now point to a block in which all instructions are LCSSA phi node (except the terminator), and the sole successor of that block should point to the latch block of the outer loop.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86133

Files:
  llvm/lib/Analysis/LoopNestAnalysis.cpp
  llvm/test/Analysis/LoopNestAnalysis/nests-with-lcssa.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86133.286245.patch
Type: text/x-patch
Size: 8965 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200818/a9091c70/attachment-0001.bin>


More information about the llvm-commits mailing list