diff --git a/llvm/tools/llvm-profgen/ProfileGenerator.cpp b/llvm/tools/llvm-profgen/ProfileGenerator.cpp --- a/llvm/tools/llvm-profgen/ProfileGenerator.cpp +++ b/llvm/tools/llvm-profgen/ProfileGenerator.cpp @@ -559,15 +559,14 @@ FunctionProfile.getContext().getNameWithoutContext(), Count); } } - - // Assign zero count for remaining probes without sample hits to - // differentiate from probes optimized away, of which the counts are unknown - // and will be inferred by the compiler. - for (auto &I : FrameSamples) { - auto *FunctionProfile = I.second; - for (auto *Probe : I.first->getProbes()) { - FunctionProfile->addBodySamplesForProbe(Probe->getIndex(), 0); - } + } + // Assign zero count for remaining probes without sample hits to + // differentiate from probes optimized away, of which the counts are unknown + // and will be inferred by the compiler. + for (auto &I : FrameSamples) { + auto *FunctionProfile = I.second; + for (auto *Probe : I.first->getProbes()) { + FunctionProfile->addBodySamplesForProbe(Probe->getIndex(), 0); } } }