[PATCH] D90272: [BranchProbabilityInfo] Fix eraseBlock
Wei Mi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 27 16:12:15 PDT 2020
wmi accepted this revision.
wmi added a comment.
This revision is now accepted and ready to land.
LGTM.
================
Comment at: llvm/lib/Analysis/BranchProbabilityInfo.cpp:1141-1144
+ if (MaxSuccIdx.find(Src) == MaxSuccIdx.end())
+ MaxSuccIdx[Src] = IndexInSuccessors;
+ else
+ MaxSuccIdx[Src] = std::max(MaxSuccIdx[Src], IndexInSuccessors);
----------------
If Src doesn't exist in MaxSuccIdx, MaxSuccIdx[Src] will return 0. Can it be simplified to one statement?
MaxSuccIdx[Src] = std::max(MaxSuccIdx[Src], IndexInSuccessors);
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90272/new/
https://reviews.llvm.org/D90272
More information about the llvm-commits
mailing list