[PATCH] D107034: [CSPGO] Set EnableValueProfiling flag for CSPGO to avoid IRPGO value loss in LTO

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 19 23:08:29 PDT 2021


MaskRay added a comment.

About this patch `M.addModuleFlag(llvm::Module::Warning, "EnableValueProfiling", 1);`: I am not so sure we should do it.

Note that we only set "EnableValueProfiling" to 0 for the `clang -fprofile-instr-generate` case. The value is not set to 1 (without poking into the internal `-enable-value-profiling` option).

`clang -fprofile-generate` with value profiling doesn't set this module flag, so -fcs-profile-generate doesn't need to set it, either.



================
Comment at: lld/COFF/LTO.cpp:226
     if (config->saveTemps)
-      saveBuffer(buf[i], ltoObjName);
+      saveBuffer(objBuf, ltoObjName);
     ret.push_back(make<ObjFile>(MemoryBufferRef(objBuf, ltoObjName)));
----------------
drop unrelated change


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107034/new/

https://reviews.llvm.org/D107034



More information about the llvm-commits mailing list