[llvm-branch-commits] [llvm] [CodeGen][StaticDataSplitter]Support constant pool partitioning (PR #129781)

Wei Xiao via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Mar 6 05:10:32 PST 2025


================
@@ -148,17 +184,9 @@ bool StaticDataSplitter::partitionStaticDataWithProfiles(MachineFunction &MF) {
 
           if (MJTI->updateJumpTableEntryHotness(JTI, Hotness))
             ++NumChangedJumpTables;
-        } else {
-          // Find global variables with local linkage.
-          const GlobalVariable *GV =
-              getLocalLinkageGlobalVariable(Op.getGlobal());
-          // Skip 'special' global variables conservatively because they are
-          // often handled specially, and skip those not in static data
-          // sections.
-          if (!GV || GV->getName().starts_with("llvm.") ||
-              !inStaticDataSection(GV, TM))
-            continue;
-          SDPI->addConstantProfileCount(GV, Count);
+        } else if (const Constant *C =
+                       getConstant(Op, MF.getTarget(), MF.getConstantPool())) {
+          SDPI->addConstantProfileCount(C, Count);
----------------
williamweixiao wrote:

yes, we don't need to update "NumChangedJumpTables" here. but why do we need to return "true" or "false" for this function?

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


More information about the llvm-branch-commits mailing list