[all-commits] [llvm/llvm-project] 98c611: [LoopNest] Use `getUniqueSuccessor()` instead when...

Ta-Wei Tu via All-commits all-commits at lists.llvm.org
Tue Feb 23 17:53:30 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 98c6110d9bdda166a6093f8fdf1320b5f477ecbe
      https://github.com/llvm/llvm-project/commit/98c6110d9bdda166a6093f8fdf1320b5f477ecbe
  Author: Ta-Wei Tu <tu.da.wei at gmail.com>
  Date:   2021-02-24 (Wed, 24 Feb 2021)

  Changed paths:
    M llvm/lib/Analysis/LoopNestAnalysis.cpp
    A llvm/test/Analysis/LoopNestAnalysis/duplicate-successors.ll

  Log Message:
  -----------
  [LoopNest] Use `getUniqueSuccessor()` instead when checking empty blocks

Blocks that contain only a single branch instruction to the next block can be skipped in analyzing the loop-nest structure.
This is currently done by `getSingleSuccessor()`.
However, the branch instruction might have multiple targets which happen to all be the same.
In this case, the block should still be considered as empty and skipped.

An example is `test/Transforms/LoopInterchange/update-condbranch-duplicate-successors.ll` (the LIT test for this patch is modified from it as well).

Reviewed By: Whitney

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




More information about the All-commits mailing list