[all-commits] [llvm/llvm-project] abbd65: [LoopNest] False negative of `arePerfectlyNested` ...

Ta-Wei Tu via All-commits all-commits at lists.llvm.org
Tue Aug 25 09:21:19 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: abbd652dd6db94c1f2e851431638830f3ceccbcc
      https://github.com/llvm/llvm-project/commit/abbd652dd6db94c1f2e851431638830f3ceccbcc
  Author: Ta-Wei Tu <tu.da.wei at gmail.com>
  Date:   2020-08-25 (Tue, 25 Aug 2020)

  Changed paths:
    M llvm/lib/Analysis/LoopNestAnalysis.cpp
    A llvm/test/Analysis/LoopNestAnalysis/nests-with-lcssa.ll

  Log Message:
  -----------
  [LoopNest] False negative of `arePerfectlyNested` with LCSSA loops

Summary: 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.

Reviewed By: Whitney, etiotto

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




More information about the All-commits mailing list