[LoopInterchange] Check lcssa phis in the inner latch in scenarios of multi-level...
authorCongzhe Cao <congzhe.cao@huawei.com>
Fri, 16 Jul 2021 15:47:11 +0000 (11:47 -0400)
committerCongzheUalberta <congzhecao@gmail.com>
Fri, 16 Jul 2021 15:59:20 +0000 (11:59 -0400)
commita7b7d22d6ead13c44a8ff55ad119179fbb3d1686
tree58b69314f3305edaf8f7871a0d658a4da52569bd
parentfbc3e69f58d0e2e8e143c2a098cc7443bae2fdbb
[LoopInterchange] Check lcssa phis in the inner latch in scenarios of multi-level nested loops

We already know that we need to check whether lcssa
phis are supported in inner loop exit block or in
outer loop exit block, and we have logic to check
them already. Presumably the inner loop latch does
not have lcssa phis and there is no code that deals
with lcssa phis in the inner loop latch. However,
that assumption is not true, when we have loops
with more than two-level nesting. This patch adds
checks for lcssa phis in the inner latch.

Reviewed By: Whitney

Differential Revision: https://reviews.llvm.org/D102300
llvm/lib/Transforms/Scalar/LoopInterchange.cpp
llvm/test/Transforms/LoopInterchange/innermost-latch-uses-values-in-middle-header.ll [new file with mode: 0644]