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 @@ -434,7 +434,7 @@ 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))