================ @@ -1359,14 +1359,43 @@ void annotateValueSite(Module &M, Instruction &Inst, // Value Profile Data uint32_t MDCount = MaxMDCount; + // Zero values might occur multiple times (e.g., multiple functions that + // cannot be remapped). Deduplicate them to enforce the variant that + // values are unique, which allows passes to make some simplifying + // assumptions. + // TODO(boomanaiden154): This fits more naturally in addValueData, but + // preserving the current behavior is necessary for some error handling + // paths. When that gets cleaned up, we should move this there. + // TODO(boomanaiden154): We are also deduplicating non-zero values. + // These are rare and should only come from corrupted profiles, so we + // just skip them. Remove this when they are fixed properly in + // llvm-profdata. + std::optional<uint64_t> ZeroCount = std::nullopt; ---------------- boomanaiden154 wrote:
Essentially `std::nullopt`. I've updated the code to drop the `std::optional`. https://github.com/llvm/llvm-project/pull/196649 _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
