[PM] Separate the InstCombiner from its pass.
authorChandler Carruth <chandlerc@gmail.com>
Tue, 20 Jan 2015 22:44:35 +0000 (22:44 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 20 Jan 2015 22:44:35 +0000 (22:44 +0000)
commit622a4bdaa77e4f97bae5fe50b9ac757423e7d4e8
tree5da7ee4b3aab92674aa9d61997a65c3a1a3b7918
parent6b89efe3750175e3cdc2900bed9917b891ff7f24
[PM] Separate the InstCombiner from its pass.

This creates a small internal pass which runs the InstCombiner over
a function. This is the hard part of porting InstCombine to the new pass
manager, as at this point none of the code in InstCombine has access to
a Pass object any longer.

The resulting interface for the InstCombiner is pretty terrible. I'm not
planning on leaving it that way. The key thing missing is that we need
to separate the worklist from the combiner a touch more. Once that's
done, it should be possible for *any* part of LLVM to just create
a worklist with instructions, populate it, and then combine it until
empty. The pass will just be the (obvious and important) special case of
doing that for an entire function body.

For now, this is the first increment of factoring to make all of this
work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226618 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/InitializePasses.h
lib/LTO/LTOCodeGenerator.cpp
lib/Transforms/InstCombine/InstCombine.h
lib/Transforms/InstCombine/InstructionCombining.cpp