[PATCH] D90838: [BranchProbabilityInfo] Remove block handles in eraseBlock()
Yevgeny Rouban via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 5 22:14:47 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe38c8e7590a0: [BranchProbabilityInfo] Remove block handles in eraseBlock() (authored by yrouban).
Changed prior to commit:
https://reviews.llvm.org/D90838?vs=303083&id=303330#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90838/new/
https://reviews.llvm.org/D90838
Files:
llvm/include/llvm/Analysis/BranchProbabilityInfo.h
llvm/lib/Analysis/BranchProbabilityInfo.cpp
Index: llvm/lib/Analysis/BranchProbabilityInfo.cpp
===================================================================
--- llvm/lib/Analysis/BranchProbabilityInfo.cpp
+++ llvm/lib/Analysis/BranchProbabilityInfo.cpp
@@ -1138,10 +1138,10 @@
if (Probs.size() == 0)
return; // Nothing to set.
+ Handles.insert(BasicBlockCallbackVH(Src, this));
uint64_t TotalNumerator = 0;
for (unsigned SuccIdx = 0; SuccIdx < Probs.size(); ++SuccIdx) {
this->Probs[std::make_pair(Src, SuccIdx)] = Probs[SuccIdx];
- Handles.insert(BasicBlockCallbackVH(Src, this));
LLVM_DEBUG(dbgs() << "set edge " << Src->getName() << " -> " << SuccIdx
<< " successor probability to " << Probs[SuccIdx]
<< "\n");
@@ -1177,6 +1177,7 @@
// a pair (BB, N) if there is no data for (BB, N-1) because the data is always
// set for all successors from 0 to M at once by the method
// setEdgeProbability().
+ Handles.erase(BasicBlockCallbackVH(BB, this));
for (unsigned I = 0;; ++I) {
auto MapI = Probs.find(std::make_pair(BB, I));
if (MapI == Probs.end()) {
Index: llvm/include/llvm/Analysis/BranchProbabilityInfo.h
===================================================================
--- llvm/include/llvm/Analysis/BranchProbabilityInfo.h
+++ llvm/include/llvm/Analysis/BranchProbabilityInfo.h
@@ -213,7 +213,6 @@
void deleted() override {
assert(BPI != nullptr);
BPI->eraseBlock(cast<BasicBlock>(getValPtr()));
- BPI->Handles.erase(*this);
}
public:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90838.303330.patch
Type: text/x-patch
Size: 1540 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201106/5af72a77/attachment.bin>
More information about the llvm-commits
mailing list