LPM: Simplify how passes mark loops for deletion. NFC
authorJustin Bogner <mail@justinbogner.com>
Wed, 16 Dec 2015 00:01:02 +0000 (00:01 +0000)
committerJustin Bogner <mail@justinbogner.com>
Wed, 16 Dec 2015 00:01:02 +0000 (00:01 +0000)
commit6da3c1a607b46bdba580daed56557abf37e8920d
tree6d28babe9c1009c43ea3115403b15727a2db5ba4
parentd532d9e346c6925fa626c92ad2b47692e3758886
LPM: Simplify how passes mark loops for deletion. NFC

When a pass removes a loop it currently has to reach up into the
LPPassManager's internals to update the state of the iteration over
loops. This reverse dependency results in a pretty awkward interplay
of the LPPassManager and its Passes.

Here, we change this to instead keep track of when a loop has become
"unlooped" in the Loop objects themselves, then the LPPassManager can
check this and manipulate its own state directly. This opens the door
to allow most of the loop passes to work without a backreference to
the LPPassManager.

I've kept passes calling the LPPassManager::deleteLoopFromQueue API
now so I could put an assert in to prove that this is NFC, but a later
pass will update passes just to preserve the LoopInfo directly and
stop referencing the LPPassManager completely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255720 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/LoopInfo.h
include/llvm/Analysis/LoopPass.h
lib/Analysis/LoopInfo.cpp
lib/Analysis/LoopPass.cpp