]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commit
[PM] Refactor the InstCombiner interface to use an external worklist.
authorChandler Carruth <chandlerc@gmail.com>
Wed, 21 Jan 2015 11:38:17 +0000 (11:38 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 21 Jan 2015 11:38:17 +0000 (11:38 +0000)
commit9d4f87e9be9f1494aa1b1d6d72a2d9a4b958a69b
treef009e33d617388965883d484afc1bd758461ea3d
parent67d52573742da2951054df93aae3d1132352d4f7
[PM] Refactor the InstCombiner interface to use an external worklist.

Because in its primary function pass the combiner is run repeatedly over
the same function until doing so produces no changes, it is essentially
to not re-allocate the worklist. However, as a utility, the more common
pattern would be to put a limited set of instructions in the worklist
rather than the entire function body. That is also the more likely
pattern when used by the new pass manager.

The result is a very light weight combiner that does the visiting with
a separable worklist. This can then be wrapped up in a helper function
for users that want a combiner utility, or as I have here it can be
wrapped up in a pass which manages the iterations used when combining an
entire function's instructions.

Hopefully this removes some of the worst of the interface warts that
became apparant with the last patch here. However, there is clearly more
work. I've again left some FIXMEs for the most egregious. The ones that
stick out to me are the exposure of the worklist and IR builder as
public members, and the use of pointers rather than references. However,
fixing these is likely to be much more mechanical and less interesting
so I didn't want to touch them in this patch.

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