vsk added a comment. It looks like this patch is OK to land, minus changes related to SelectionDAG:: getTargetIndex. I filed http://llvm.org/PR30625 about adding test coverage for that function. I'll commit this later today if there are no more issues. https://reviews.llvm.org/D24435