[LegacyPM] Make the 'addLoop' method accept a loop to add rather than
authorChandler Carruth <chandlerc@gmail.com>
Thu, 25 May 2017 03:01:31 +0000 (03:01 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 25 May 2017 03:01:31 +0000 (03:01 +0000)
commit29c22d2835acf876c60e90c3f527bfc1b66c152f
treee0e8ab63b55d8e48d5e81bc848967480d171517e
parentd5c65ffa8dd419b618b1c28602637d3e816d8a94
[LegacyPM] Make the 'addLoop' method accept a loop to add rather than
having it internally allocate the loop.

This is a much more flexible API and necessary in the new loop unswitch
to reasonably support both new and old PMs in common code. It also just
seems like a cleaner separation of concerns.

NFC, this should just be a pure refactoring.

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

llvm-svn: 303834
llvm/include/llvm/Analysis/LoopPass.h
llvm/lib/Analysis/LoopPass.cpp
llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
llvm/lib/Transforms/Scalar/LoopUnswitch.cpp