If you're going to discuss such a design change, might I suggest starting a thread for that purpose? And link to this thread/phab<span></span>ricator patch, of course.<div><br></div><div>Thanks,</div><div><br></div><div>  Filipe<br><br>On Thursday, March 19, 2015, Davide Italiano <<a href="mailto:davide@freebsd.org">davide@freebsd.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Mar 20, 2015 at 2:33 AM, Sean Silva <<a href="javascript:;" onclick="_e(event, 'cvml', 'chisophugis@gmail.com')">chisophugis@gmail.com</a>> wrote:<br>
> I really don't like this approach. It has large memory contention in the inner loop even though this computation doesn't inherently have any. Also it is using an extremely cache-unfriendly design, along with putting a `new` into the inner loop, causing contention inside the memory allocator besides the usual allocation slowness.<br>
><br>
> We could just store a bit inside the Atom that marks it as dead. That avoids a bunch of hash table lookups in the _deadAtoms map anyway. We have a ton of space in the Atom base class in the _definition field, which is only using 2 bits of a pointer-aligned field (aligned to the vptr). We already have the _definition field loaded (and in cache) due to the dyn_cast above (which checks _definition). So it's just an OR and a store to mark it: no extra loads, no extra cache misses, no synchronization.<br>
><br>
><br>
<br>
I like your design better, no doubt, but as previously discussed this<br>
needs some fundamental re-design of the code (i.e. atoms  can't be<br>
passed as const anymore). cc:ing all the other people involved so we<br>
can have a discussion about pro/cons and if this is the direction we<br>
want to take.<br>
<br>
<br>
--<br>
Davide<br>
<br>
"There are no solved problems; there are only problems that are more<br>
or less solved" -- Henri Poincare<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'llvm-commits@cs.uiuc.edu')">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br>-- <br>  F<br><br>