[LoopVectorize] Preserve CFG analyses if CFG wasn't modified
authorMax Kazantsev <mkazantsev@azul.com>
Fri, 24 Apr 2020 10:02:37 +0000 (17:02 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Fri, 24 Apr 2020 10:22:24 +0000 (17:22 +0700)
commit9cd4debd5ae43b03c96a2f8f24c73c5fd317d8ac
tree9b430d3361300630b6278e6e120f66833ce518b6
parentdb7997472bbd01645f058b23a4ca9e991d5b8144
[LoopVectorize] Preserve CFG analyses if CFG wasn't modified

One of transforms the loop vectorizer makes is LCSSA formation. In some cases it
is the only transform it makes. We should not drop CFG analyzes if only LCSSA was
formed and no actual CFG changes was made.

We should think of expanding this logic to other passes as well, and maybe make
it a part of PM framework.

Reviewed By: Florian Hahn
Differential Revision: https://reviews.llvm.org/D78360
llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/novect-lcssa-cfg-invalidation.ll