[PATCH] D89723: [CSSPGO][llvm-profgen]Context-sensitive profile data generation
Hongtao Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 18 16:24:12 PST 2020
hoy added inline comments.
================
Comment at: llvm/tools/llvm-profgen/PerfReader.h:265
+ static bool isHybridPerfScript(StringRef FileName) {
+ auto BufOrError = MemoryBuffer::getFileOrSTDIN(FileName, 4000);
+ if (!BufOrError)
----------------
wlei wrote:
> hoy wrote:
> > Should this be rewritten with a stream-based file reader as done in D89707?
> I guess you mean to keep consistent to other part of code? Here you see it only read 4000bytes data from the file(`getFileOrSTDIN(FileName, 4000);`), so there shouldn't have memory issue.
> Currently stream-based liner only support read one line at a time, it need to search line by line, which would be slower than searching in the whole 4k memory. So which one do you prefer?
I see. The current implementation looks good to me.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89723/new/
https://reviews.llvm.org/D89723
More information about the llvm-commits
mailing list