LPM: Stop threading `Pass *` through all of the loop utility APIs. NFC
authorJustin Bogner <mail@justinbogner.com>
Tue, 15 Dec 2015 19:40:57 +0000 (19:40 +0000)
committerJustin Bogner <mail@justinbogner.com>
Tue, 15 Dec 2015 19:40:57 +0000 (19:40 +0000)
commit591c3d8fe6cae3200b7a2ef9e9f60e68aeea3760
treeea67fa391ba2cffd009b2b2760ff7367ec7ec69f
parentac785122aba50336650c598002c34642754f8af0
LPM: Stop threading `Pass *` through all of the loop utility APIs. NFC

A large number of loop utility functions take a `Pass *` and reach
into it to find out which analyses to preserve. There are a number of
problems with this:

- The APIs have access to pretty well any Pass state they want, so
  it's hard to tell what they may or may not do.

- Other APIs have copied these and pass around a `Pass *` even though
  they don't even use it. Some of these just hand a nullptr to the API
  since the callers don't even have a pass available.

- Passes in the new pass manager don't work like the current ones, so
  the APIs can't be used as is there.

Instead, we should explicitly thread the analysis results that we
actually care about through these APIs. This is both simpler and more
reusable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255669 91177308-0d34-0410-b5e6-96231b3b80d8
18 files changed:
include/llvm/Transforms/Utils/LoopUtils.h
include/llvm/Transforms/Utils/SimplifyIndVar.h
include/llvm/Transforms/Utils/UnrollLoop.h
lib/Target/PowerPC/PPCCTRLoops.cpp
lib/Target/PowerPC/PPCLoopPreIncPrep.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/LoopDistribute.cpp
lib/Transforms/Scalar/LoopInterchange.cpp
lib/Transforms/Scalar/LoopRerollPass.cpp
lib/Transforms/Scalar/LoopStrengthReduce.cpp
lib/Transforms/Scalar/LoopUnrollPass.cpp
lib/Transforms/Scalar/PlaceSafepoints.cpp
lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
lib/Transforms/Utils/FlattenCFG.cpp
lib/Transforms/Utils/LoopSimplify.cpp
lib/Transforms/Utils/LoopUnroll.cpp
lib/Transforms/Utils/LoopUnrollRuntime.cpp
lib/Transforms/Utils/SimplifyIndVar.cpp