Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BFI] Use CallbackVH to notify BFI about deletion of basic blocks
With AssertingVHs instead of bare pointers in BlockFrequencyInfoImpl::Nodes (but without CallbackVHs) ~1/36 of all tests ran by make check fail. It means that there are users of BFI that delete basic blocks while keeping BFI. Some of those transformations add new basic blocks, so if a new basic block happens to be allocated at address where an already deleted block was and we don't explicitly set block frequency for that new block, BFI will report some non-default frequency for the block even though frequency for the block was never set. Inliner is an example of a transformation that adds and removes BBs while querying and updating BFI. With this patch, thanks to updates via CallbackVH, BFI won't keep stale pointers in its Nodes map. This is a resubmission of 408349a with fixed compiler warning and MSVC compilation error. Reviewers: davidxl, yamauchi, asbirlea, fhahn, fedor.sergeev Reviewed-By: asbirlea, davidxl Tags: #llvm Differential Revision: https://reviews.llvm.org/D75341
- Loading branch information
1 parent
7202d9c
commit b313897
Showing
2 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters