[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:53 PDT 2025
================
@@ -2769,6 +2769,23 @@ namespace {
} // end anonymous namespace
+StringRef AsmPrinter::getConstantSectionSuffix(const Constant *C) const {
----------------
snehasish wrote:
Consider refactoring a bit to reduce nesting --
```
if(!TM.Options.EnableStaticDataPartitioning || C == nullptr || SDPI == nullptr || PSI == nullptr) return "";
auto Count = SDPI->getConstantProfileCount(C);
if(!Count.has_value()) return "";
if (PSI->isHotCount(*Count)) {
return "hot";
} else if (PSI->isColdCount(*Count) && !SDPI->hasUnknownCount(C)) {
return "unlikely";
}
return "";
```
https://github.com/llvm/llvm-project/pull/129781
More information about the llvm-branch-commits
mailing list