[LoopInterchange] Fix handling of LCSSA nodes defined in headers and latches.
authorFlorian Hahn <flo@fhahn.com>
Sun, 26 May 2019 23:38:25 +0000 (23:38 +0000)
committerFlorian Hahn <flo@fhahn.com>
Sun, 26 May 2019 23:38:25 +0000 (23:38 +0000)
commit11b2f4fe50dae42d070bfdd798cc29a70dad320a
tree01926bc952e63a8b117340489f40fac03a00741c
parente698958ad8031e0f17202e06f5de53989852bb66
[LoopInterchange] Fix handling of LCSSA nodes defined in headers and latches.

The code to preserve LCSSA PHIs currently only properly supports
reduction PHIs and PHIs for values defined outside the latches.

This patch improves the LCSSA PHI handling to cover PHIs for values
defined in the latches.

Fixes PR41725.

Reviewers: efriedma, mcrosier, davide, jdoerfert

Reviewed By: jdoerfert

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

llvm-svn: 361743
llvm/lib/Transforms/Scalar/LoopInterchange.cpp
llvm/test/Transforms/LoopInterchange/perserve-lcssa.ll [new file with mode: 0644]