[PATCH] D150466: profilie inference changes for stale profile matching
Hongtao Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 12 11:03:18 PDT 2023
hoy added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/SampleProfileInference.cpp:1236
+ for (auto &Jump : Block.SuccJumps) {
+ assert(UniqueSuccs.find(Jump->Target) == UniqueSuccs.end() &&
+ "input CFG contains parallel edges");
----------------
nit: you can just assert on the return value of the insert operation, which returns a pair consisting of an iterator to the inserted element (or to the element that prevented the insertion) and a bool denoting whether the insertion took place.
================
Comment at: llvm/lib/Transforms/Utils/SampleProfileInference.cpp:1339
+ // Quit early for functions with a single block or ones w/o samples
+ if (Func.Blocks.size() <= 1 || !HasSamples)
+ return;
----------------
Wondering in what cases a function doesn't come in with samples? Thought we should have bailed out on a higher level in the sample loader.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150466/new/
https://reviews.llvm.org/D150466
More information about the llvm-commits
mailing list