[ADCE] Fix incorrect reporting of CFG changes
authorMax Kazantsev <mkazantsev@azul.com>
Tue, 14 Apr 2020 13:25:31 +0000 (20:25 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Tue, 14 Apr 2020 13:26:13 +0000 (20:26 +0700)
commitf8a42bca2812fb602b0f2f24ce60f8216f6ddf87
tree201c41a27aaf4bbc630b40a672a25d13c00b83c2
parent440b445fff848aded09fe5f7d69ff690113e44e2
[ADCE] Fix incorrect reporting of CFG changes

This patch fixes 2 related bugs in ADCE:
- `performDeadCodeElimination` does not report changes if it did ONLY
  CFG changes (affects both old and new pass managers);
- When control flow removal is enabled, new pass manager does not
  drop CFG analyses.

Both can lead to incorrect loop info after ADCE that does only CFG changes.

Differential Revision: https://reviews.llvm.org/D78103
Reviewed By: Denis Antrushin
llvm/lib/Transforms/Scalar/ADCE.cpp
llvm/test/Transforms/ADCE/broken-loop-info.ll