hfinkel added a comment. Do we not unqiue MDNodes? This seems like a lot of code for what I would have thought should be: Compare the pointer equality all MDNode operands except the first (because the first is the unique loop id). http://reviews.llvm.org/D19075