BranchProbabilityInfo::eraseBlock() is a public method and can be called without deleting the block itself.
I believe this method should remove the correspondent tracking handle from BranchProbabilityInfo::Handles along with the probabilities of the block. So I propose to move Handles.erase() call to eraseBlock().
In setEdgeProbability() we need to add the block handle only once.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM. Thanks!
llvm/include/llvm/Analysis/BranchProbabilityInfo.h | ||
---|---|---|
216 | While you are at this, could you make BranchProbabilityInfo::Handles private? |
llvm/include/llvm/Analysis/BranchProbabilityInfo.h | ||
---|---|---|
216 | It is private. |
llvm/include/llvm/Analysis/BranchProbabilityInfo.h | ||
---|---|---|
216 | Sorry, I missed that. Thank you for checking! |
While you are at this, could you make BranchProbabilityInfo::Handles private?