[BranchProbabilityInfo] Remove block handles in eraseBlock()
authorYevgeny Rouban <yrouban@azul.com>
Fri, 6 Nov 2020 06:11:08 +0000 (13:11 +0700)
committerYevgeny Rouban <yrouban@azul.com>
Fri, 6 Nov 2020 06:13:58 +0000 (13:13 +0700)
commite38c8e7590a0a82be24f3bcc5b87736498f2cb07
tree412eed2d444a7b21dca3106ca8b555ac3aeee177
parent60e2c5b03b590fbb1477d3d7170d5bd434b39ce9
[BranchProbabilityInfo] Remove block handles in eraseBlock()

BranchProbabilityInfo::eraseBlock() is a public method and
can be called without deleting the block itself.
This method is made remove the correspondent tracking handle
from BranchProbabilityInfo::Handles along with
the probabilities of the block. Handles.erase() call is moved
to eraseBlock().
In setEdgeProbability() we need to add the block handle only once.

Reviewed By: kazu

Differential Revision: https://reviews.llvm.org/D90838
llvm/include/llvm/Analysis/BranchProbabilityInfo.h
llvm/lib/Analysis/BranchProbabilityInfo.cpp