[PATCH] D15230: [BranchFolding] Merge MMOs during tail merge

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 11:51:35 PST 2016


reames added a comment.

I've landed two changes (r256966 and r256909) which clarify the semantics of MMO merging.  This patch should be rebased over the generic merging infrastructure now in place so that other parts of the backend can pick them up.

I still think the merging algorithm used here is unnecessarily inefficient.  There's no reason this merge step shouldn't scale to the maximum number of memrefs we allow.  I suggested in an offlist email that we use a std::sort idiom.  That is slightly complicated by the need to sort the pointers based on the contents of objects reachable through pointers, but that still seems like the right approach.  A custom comparator function or lambda would be perfect in this context.

If you'd rather, I'm happy to write up a patch which implements that.  The only thing I would need is a couple of test cases which show the need for it so that I can tell if the code is actually correct.  (The tests would be mandatory for the rebased version of this change as well.)


http://reviews.llvm.org/D15230





More information about the llvm-commits mailing list