davide added a comment. This looks much better now. Can you please add a comment in the code explaining the algorithm (if I missed it, please point out) while I take a last look? Thanks. Repository: rL LLVM https://reviews.llvm.org/D28549