[llvm] [NFC]Refactor static data splitter (PR #125758)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 14:40:56 PST 2025


================
@@ -77,13 +77,22 @@ bool StaticDataSplitter::runOnMachineFunction(MachineFunction &MF) {
   MBFI = &getAnalysis<MachineBlockFrequencyInfoWrapperPass>().getMBFI();
   PSI = &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI();
 
-  return splitJumpTables(MF);
+  const bool ProfileAvailable = PSI && PSI->hasProfileSummary() && MBFI &&
+                                MF.getFunction().hasProfileData();
+  bool Changed = false;
+
+  if (ProfileAvailable)
+    Changed |= partitionStaticDataWithProfiles(MF);
+
+  updateStats(ProfileAvailable, MF.getJumpTableInfo());
----------------
mingmingl-llvm wrote:

I revised the change to have `updateStatsWithoutProfiles` and `updateStatsWithProfiles`, and moved `updateStatsWithoutProfiles` up.

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


More information about the llvm-commits mailing list