[llvm-commits] PATCH: Teach the function cloner to prune dead basic blocks

Chris Lattner clattner at apple.com
Fri Mar 30 13:52:55 PDT 2012


On Mar 25, 2012, at 1:21 PM, Chandler Carruth wrote:

> On Sun, Mar 25, 2012 at 12:17 PM, Chris Lattner <clattner at apple.com> wrote:
> WeakVH is *substantially* more expensive than AssertingVH.  The later is just a raw pointer when assertions are disabled.
> 
> 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.
>  
> The former requires densemap operations when a WeakVH is modified.
> 
> Why is it expensive to update the value mapping?
> 
> We have to update everything that maps *to* the deleted instructions. That's a full walk of the value map for each instruction deleted.

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.

However, if there is no measured compile time hit at -O2 or -O3, then I'm ok with it.  I do like the simplicity.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120330/96733f83/attachment.html>


More information about the llvm-commits mailing list