[PATCH] D36963: Use sorting instead of a lot of stable_partitions for `ICF::segregate` function

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 13:52:48 PDT 2017


On Fri, Aug 25, 2017 at 1:47 PM, Alex Telishev via Phabricator <
reviews at reviews.llvm.org> wrote:

> alex.telishev added a comment.
>
> > Now consider lessVariable(C1, C2). At line 191, lessVariable returns
> true because S1<S2. How about lessVariable(C2, C3)? At line 191,
> lessVaraible returns true because S2<S3. At this point, it concludes that
> C1<C2<C3. But that's wrong because both lessVaraible(C1, C3) and
> lessVariable(C3, C1) return false. That's what I was saying that the
> comparison function is not transitive.
>
> I thought about that, this problem is taken care of because of type
> comparion - lessVariable(C1, C2) will `return false` at line 141. Actually,
> at line 191 we can only be both `nullptr` or both not.
>

Line 141 seems a blank line.


> https://reviews.llvm.org/D36963
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170825/59add338/attachment.html>


More information about the llvm-commits mailing list