[llvm] [SampleFDO] Support enabling sample loader pass in O0 mode (PR #113985)

Lei Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 21:18:42 PST 2024


================
@@ -1975,6 +1977,13 @@ bool SampleProfileLoader::doInitialization(Module &M,
 
   PSL = Reader->getProfileSymbolList();
 
+  if (DisableSampleLoaderInlining.getNumOccurrences())
+    DisableSampleProfileInlining = DisableSampleLoaderInlining;
+
+  // Use flattened profile if inlining is disabled.
+  if (DisableSampleProfileInlining && !Reader->profileIsCS())
+    ProfileConverter::flattenProfile(Reader->getProfiles());
----------------
wlei-llvm wrote:

OK. Good point, sounds good to use flattened profile for only O0 mode.

https://github.com/llvm/llvm-project/pull/113985


More information about the llvm-commits mailing list