[LICM] Make sinkRegion and hoistRegion non-recursive

Large CFGs can cause us to blow up the stack because we would have a
recursive step for each basic block in a region.

Instead, create a worklist and iterate it. This limits the stack usage
to something more manageable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308582 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed