mcrosier added a comment. I've done a bit of refactoring in r286601 and r286606, which I hope makes this a much easier code review. If you rebase the patch, I'd be happy to take a look. Repository: rL LLVM https://reviews.llvm.org/D25966