diff --git a/llvm/tools/llvm-profgen/PerfReader.cpp b/llvm/tools/llvm-profgen/PerfReader.cpp index e9442027aed3fa..e63c6d61b3bfcc 100644 --- a/llvm/tools/llvm-profgen/PerfReader.cpp +++ b/llvm/tools/llvm-profgen/PerfReader.cpp @@ -552,7 +552,7 @@ bool PerfScriptReader::extractLBRStack(TraceStream &TraceIt, // ... 0x4005c8/0x4005dc/P/-/-/0 // It's in FIFO order and seperated by whitespace. SmallVector Records; - TraceIt.getCurrentLine().split(Records, " ", -1, false); + TraceIt.getCurrentLine().rtrim().split(Records, " ", -1, false); auto WarnInvalidLBR = [](TraceStream &TraceIt) { WithColor::warning() << "Invalid address in LBR record at line " << TraceIt.getLineNumber() << ": "