[PATCH] D89723: [CSSPGO][llvm-profgen]Context-sensitive profile data generation

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 12:07:42 PST 2020


wlei 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)
----------------
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?


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