dberlin added a comment. Here's an alternative diff that works and does not require slowing down IDFCalculator (when not all things care about the order of the end result): https://reviews.llvm.org/differential/diff/78091/ https://reviews.llvm.org/D26704