<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Mar 25, 2012, at 1:21 PM, Chandler Carruth wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Sun, Mar 25, 2012 at 12:17 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":43h">WeakVH is *substantially* more expensive than AssertingVH.  The later is just a raw pointer when assertions are disabled.</div></blockquote><div><br></div><div>Yep, but that's not what this patch changes. The value map is currently using a *TrackingVH*, not an AssertingVH. My understanding is that TrackingVH isn't substantially less expensive than WeakVH. Both have to be updated on RAUW. WeakVH has to be updated on delete as well, but this patch adds the first delete operations.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":43h">The former requires densemap operations when a WeakVH is modified.<br>
<br>
Why is it expensive to update the value mapping?<br></div></blockquote><div><br></div><div>We have to update everything that maps *to* the deleted instructions. That's a full walk of the value map for each instruction deleted.</div>
</div>
</blockquote></div><br><div>There are alternate designs here: for example, the instructions could be queued for deletion (and removed from their parents), but not actually removed.  A later pass could then clean stuff up.</div><div><br></div><div>However, if there is no measured compile time hit at -O2 or -O3, then I'm ok with it.  I do like the simplicity.</div><div><br></div><div>-Chris</div></body></html>