[PATCH] D120508: introducing profi flags
Hongtao Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 7 12:09:51 PST 2022
hoy added inline comments.
================
Comment at: llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h:923
const BasicBlockT *EntryBB = getEntryBB(&F);
+ ErrorOr<uint64_t> EntryWeight = getBlockWeight(EntryBB);
if (BlockWeights[EntryBB] > 0) {
----------------
Remove this since it's not used anywhere?
================
Comment at: llvm/lib/Transforms/Utils/SampleProfileInference.cpp:744-746
+ std::max(MinCostMaxFlow::MinBaseDistance,
+ std::min(Func.Blocks[Func.Entry].Flow,
+ MinCostMaxFlow::AuxCostUnlikely / (NumBlocks() + 1)));
----------------
wenlei wrote:
> Could you explain this a bit more, how does this minimizes total multiplicative Flow increase for the remaining edges?
Same question here. Looks like we are turning the previous subtraction into a division. So it's not a linear reduction anymore. For edges with smaller flow, the cost now will be much larger than previously, which would prevent adding more flow to that edge?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120508/new/
https://reviews.llvm.org/D120508
More information about the llvm-commits
mailing list