[all-commits] [llvm/llvm-project] 884bb9: [MustExec][LICM] Handle latch being part of an inn...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Oct 11 00:32:49 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 884bb97dca257b90dbe6fd0faf09512858292151
      https://github.com/llvm/llvm-project/commit/884bb97dca257b90dbe6fd0faf09512858292151
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-10-11 (Tue, 11 Oct 2022)

  Changed paths:
    M llvm/lib/Analysis/MustExecute.cpp
    M llvm/test/Analysis/MustExecute/pr57780.ll
    M llvm/test/Transforms/LICM/pr57780.ll

  Log Message:
  -----------
  [MustExec][LICM] Handle latch being part of an inner cycle (PR57780)

The algorithm in allLoopPathsLeadToBlock() does not handle the case
where the loop latch is part of the predecessor set correctly: In
this case, we may take the backedge (escaping to a different loop
iteration) and not execute other latch successors. This can happen
if the latch is part of an inner cycle.

Fixes https://github.com/llvm/llvm-project/issues/57780.

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




More information about the All-commits mailing list