================
@@ -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
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to