[PM] Refactor the core logic to run EarlyCSE over a function into an
authorChandler Carruth <chandlerc@gmail.com>
Tue, 27 Jan 2015 01:34:14 +0000 (01:34 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 27 Jan 2015 01:34:14 +0000 (01:34 +0000)
commitb63fed3b97cbeea45495eb8491c1e16f52f1b411
tree53b84b389d42ad4059daa28d1f016f80da36fe60
parentac33b1f5b33361dc94c82ff3e9e03d3d7e1c6fb3
[PM] Refactor the core logic to run EarlyCSE over a function into an
object that manages a single run of this pass.

This was already essentially how it worked. Within the run function, it
would point members at *stack local* allocations that were only live for
a single run. Instead, it seems much cleaner to have a utility object
whose lifetime is clearly bounded by the run of the pass over the
function and can use member variables in a more direct way.

This also makes it easy to plumb the analyses used into it from the pass
and will make it re-usable with the new pass manager.

No functionality changed here, its just a refactoring.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227162 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/InitializePasses.h
lib/Transforms/Scalar/EarlyCSE.cpp
lib/Transforms/Scalar/Scalar.cpp