[PATCH] D108153: [llvm-profgen] Support LBR only perf script
Lei Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 19 10:33:57 PDT 2021
wlei added inline comments.
================
Comment at: llvm/tools/llvm-profgen/PerfReader.h:550
+ SmallVector<StringRef, 32> Records;
+ Line.split(Records, " ", -1, false);
+ if (Records.size() < 2)
----------------
wenlei wrote:
> wlei wrote:
> > hoy wrote:
> > > Nit: splitting once is enough, instead of unlimited times (-1)?
> > -1(maximum number of times split) is the default value, here is for the 4th parameter which means to not keep the empty string, otherwise there are many empty record, it's not direct to get the first leading pointer. Seems C++ can't skip the middle default value.
> `Line.split(Records, " ", 1, false);` instead?
Sorry, I misunderstood. I tired `Line.split(Records, " ", 1, false);` but it showed it doesn't work, there are several leading empty space, splitting once will only separate one empty space and the remaining still start with empty space.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108153/new/
https://reviews.llvm.org/D108153
More information about the llvm-commits
mailing list