[PATCH] D26224: NewGVN

Marcello Maggioni via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 13:13:06 PST 2016


If the vector is the owner of the CongruenceClasses maybe making it a
vector of unique_ptrs would solve the problem to the root.

Marcello

2016-12-10 23:32 GMT-08:00 Daniel Berlin <dberlin at dberlin.org>:

>
>
> On Fri, Dec 9, 2016 at 6:54 PM, Marcello Maggioni via Phabricator <
> reviews at reviews.llvm.org> wrote:
>
>> kariddi added inline comments.
>>
>>
>> ================
>> Comment at: lib/Transforms/Scalar/NewGVN.cpp:1219
>> +  ExpressionAllocator.Reset();
>> +  CongruenceClasses.clear();
>> +  ExpressionToClass.clear();
>> ----------------
>> This gets cleared, but the CongruenceClasses seem to be created through
>> "new" and stored in the vector.
>>
>
>
>
>>
>> Where do they get destroyed?
>>
>> This code got lost somewhere on the branch, but yes, it should be
> properly deleting them, not just clear'ing.
>
>
>>
>> https://reviews.llvm.org/D26224
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161212/93cb2f3d/attachment.html>


More information about the llvm-commits mailing list