[PATCH] D107878: [SampleFDO] Flow Sensitive Sample FDO (FSAFDO) profile loader

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 12:14:32 PDT 2021


xur marked an inline comment as done.
xur added inline comments.


================
Comment at: llvm/include/llvm/Passes/PassBuilder.h:74-76
+    if (this->Action == SampleUse) {
+      FSProfileFile.setValue(ProfileFile);
+      FSRemappingFile.setValue(ProfileRemappingFile);
----------------
wmi wrote:
> It adds a dependency of LLVMProfileData to LLVMPasses. 
> 
> Maybe it is better to pass the related information to codegen through param instead of through internal flag? The interface to the codegen is LLVMTargetMachine::addPassesToEmitFile. An example is its param "CodeGenFileType FileType" which is got from configuration in clang/lto backend/thinlto backend/...
OK. I also find it a bit awkward to use internal flag here. Let me try to use this suggested way.


================
Comment at: llvm/lib/CodeGen/MIRSampleProfile.cpp:282
+  DenseSet<GlobalValue::GUID> InlinedGUIDs;
+  bool Changed = computeAndPropagateWeights(MF, InlinedGUIDs);
+
----------------
hoy wrote:
> Wondering whether this is needed when `EnableFSBranchProb` is false, where the weights computed are saved in an internal buffer and not used anywhere?
Indeed. I think I will remove this option.


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:371
 protected:
+#if 0
+  PredRangeT getPredecessors(BasicBlockT *BB) {
----------------
hoy wrote:
> Nit: pls remove this piece.
Sorry. I thought I cleaned the code before sending for the review.


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

https://reviews.llvm.org/D107878



More information about the llvm-commits mailing list