[PATCH] D23649: [ADT] Change the range-based for loop in DFS to normal loop. NFC.

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 11:05:01 PDT 2016


So i'm confused:

Are you saying it would try to visit the same blocks again and again, but
be blocked by the visited set?
If so, was this before your change, or after your change?

If it's after your change, you can and probably should write unit tests for
this pretty easily

Override the set implementation (which the iterator already allows) to be
one that counts insert attempts.
This should be trivial since the iterator only wants two functions: insert
and count, so you can just make a struct that has a smallptrset or
whatever, and the counts, and insert/count just increment the count and use
the smallptrset.

Build a few graphs, use iterator on them, assert the counts are correct
(that it only *tried* to visit each thing once).



On Thu, Aug 18, 2016 at 9:53 AM, Tim Shen via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> On Thu, Aug 18, 2016, 02:22 Dean Michael Berris <dberris at google.com>
> wrote:
>
>> dberris added a subscriber: dberris.
>> dberris added a comment.
>>
>> Is there a test that exposes the bug this is meant to fix?
>>
>
> Not really, since the bug only affects runtime complexity, but not
> correctness.
>
>
>>
>> https://reviews.llvm.org/D23649
>>
>>
>>
>>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160819/d3869338/attachment.html>


More information about the llvm-commits mailing list