[llvm-commits] [patch][pr11202] Handle BB with address taken being deleted from codegen

Rafael Ávila de Espíndola respindola at mozilla.com
Mon Oct 31 10:39:25 PDT 2011


Ping.

On 10/24/2011 04:02 PM, Rafael Ávila de Espíndola wrote:
> We currently handle the following cases when removing a BB that has its
> address taken
>
> * An IL pass is deleting it, and no references to it were emitted so
> far. In this case replaceAllUsesWith takes care of everything.
> * An IL pass is deleting it, but a reference to it was already emitted.
> When emitting the reference we created a CallbackVH, so now we get
> notified about the deleting and remember to produce a dummy label for it .
>
> The case we are not handling in this bug is a BB that is referenced from
> another function or global variable being remove by a codegen pass.
> There are two problems
>
> * replaceAllUsesWith will not work once we are in Codegen, so we will
> need to use dummy labels for both cases.
> * MachineBasicBlock are not Values, so we cannot use CallbackVH.
>
> What this patch does is add a method to MMI that Codegen can use to
> record that a MBB is being deleted. This is handled almost the same way
> we handle and IL BB being deleted, but we have to keep the hash table
> entry since the IL level BB will not be delete and can still be in use.
>
> Cheers,
> Rafael




More information about the llvm-commits mailing list