From c566777818bc1c1da8543769134c62042212a289 Mon Sep 17 00:00:00 2001 From: Hongtao Yu Date: Tue, 1 Nov 2022 15:17:57 -0700 Subject: [PATCH] [llvm-profgen] Fix a typo in collectProfiledFunctions As titled. The change should have minimal impact since the targets of branch samples are mostly covered by range samples. Reviewed By: wenlei, wlei Differential Revision: https://reviews.llvm.org/D137203 --- llvm/tools/llvm-profgen/ProfileGenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/tools/llvm-profgen/ProfileGenerator.cpp b/llvm/tools/llvm-profgen/ProfileGenerator.cpp index e111078..dd8f069 100644 --- a/llvm/tools/llvm-profgen/ProfileGenerator.cpp +++ b/llvm/tools/llvm-profgen/ProfileGenerator.cpp @@ -434,7 +434,7 @@ bool ProfileGeneratorBase::collectFunctionsFromRawProfile( for (auto Item : CI.second.BranchCounter) { uint64_t SourceAddress = Item.first.first; - uint64_t TargetAddress = Item.first.first; + uint64_t TargetAddress = Item.first.second; if (FuncRange *FRange = Binary->findFuncRange(SourceAddress)) ProfiledFunctions.insert(FRange->Func); if (FuncRange *FRange = Binary->findFuncRange(TargetAddress)) -- 2.7.4