diff --git a/llvm/tools/llvm-profgen/PerfReader.cpp b/llvm/tools/llvm-profgen/PerfReader.cpp --- a/llvm/tools/llvm-profgen/PerfReader.cpp +++ b/llvm/tools/llvm-profgen/PerfReader.cpp @@ -62,7 +62,7 @@ } else { // Unwind linear execution part uint64_t LeafAddr = State.CurrentLeafFrame->Address; - while (IP.Address >= Target) { + while (IP.Address >= Target && && IP.Index != 0) { uint64_t PrevIP = IP.Address; IP.backward(); // Break into segments for implicit call/return due to inlining