This change continues fixing compile time issues with LCSSA verification (started in https://reviews.llvm.org/D25364)
Currently after running pass on a single loop-nest we run LCSSA verification for all
loops in the function. This proves to be overly expensive and often not needed since
we were changing only single loop nest. Instead I propose to adopt same technique as was
used for the LoopInfo verification. We will explicitly call LCSSA verification for each
loop nest as part of the LPPassManager iteration.
This is a bit non trivial due to the fact that not all loop passes require LCSSA. See
LoopPassPrinter for example. This means that before doing verification we need to check
if LCSSA was preserved by the current pass. In order to do this we can ask "mustPreserveAnalysisID(LCSSAID)".
Unfortunately LCSSA is part of the TransformsUtils library which depends on Analysis
library and we can't reference LCSSAID without introducing cyclic library dependence.
In order to overcome this problem I've added new analysis pass called "LCSSAVerificationPass".
It's transitively required by the LCSSA transform and preserved by all loop passes. It's
only purpose is to indicate to the LPPassManager when we need to run LCSSA verification
and when we don't.
This solution feels a bit wrong and error prone (it's enough to forget to preserve
LCSSAVerificationPass in order to miss verification). However we discussed this in
the "LCSSA verification for the top-level loops" llvm-dev thread and it seemed like
the best one.
s/lcssa/LCSSA/