[PATCH] D75341: [BFI] Use CallbackVH to notify BFI about deletion of basic blocks

Daniil Suchkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 21:01:54 PST 2020


DaniilSuchkov added a comment.

In D75341#1898807 <https://reviews.llvm.org/D75341#1898807>, @fhahn wrote:

> Alternatively I think it would be reasonable to expect the passes claiming to preserve BFI to notify BFI about deleted/added blocks, like we do for many other analysis. Do you have any idea of how much effort that would take?


Yeah, I considered this option but I don't think it's any better.
First, even with that approach we'll still need AssertingVHs in order to verify that we didn't miss any updates, and given that most of ugly const_casts are required by AssertingVH, it's not much of an improvement.
Second, CallbackVHs "automatically" notify BFI about changes, so they solve this part of the issue once and for all, while with manual notifications it'll be a classic whack-a-mole kind of effort, we'll be fixing AssertingVH's crashes on regular basis (maybe not too often though).
Third, it requires considerable amount of pretty intrusive changes, even more than providing BFI with non-const Functions/BasicBlocks does.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75341/new/

https://reviews.llvm.org/D75341





More information about the llvm-commits mailing list