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

Snehasish Kumar via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Mar 10 17:45:54 PDT 2025


================
@@ -206,14 +234,10 @@ void StaticDataSplitter::annotateStaticDataWithoutProfiles(
   for (const auto &MBB : MF) {
     for (const MachineInstr &I : MBB) {
       for (const MachineOperand &Op : I.operands()) {
-        if (!Op.isGlobal())
-          continue;
-        const GlobalVariable *GV =
-            getLocalLinkageGlobalVariable(Op.getGlobal());
-        if (!GV || GV->getName().starts_with("llvm.") ||
-            !inStaticDataSection(GV, MF.getTarget()))
-          continue;
-        SDPI->addConstantProfileCount(GV, std::nullopt);
+        const Constant *C =
----------------
snehasish wrote:

nit: Can be combined with the code below --
```
if(auto *C = getConstant(....); C) {
  SDPI->addConstantProfileCount(C, std::nullopt);
}
```

Same for `PSIW` etc below.

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


More information about the llvm-branch-commits mailing list