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

Mingming Liu via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Mar 26 13:03:54 PDT 2025


================
@@ -0,0 +1,141 @@
+; RUN: llc -mtriple=aarch64 -enable-split-machine-functions \
+; RUN:     -partition-static-data-sections=true -function-sections=true \
+; RUN:     -unique-section-names=false \
+; RUN:     %s -o - 2>&1 | FileCheck %s --dump-input=always
+
+; Repeat the RUN command above for big-endian systems.
+; RUN: llc -mtriple=aarch64_be -enable-split-machine-functions \
+; RUN:     -partition-static-data-sections=true -function-sections=true \
+; RUN:     -unique-section-names=false \
+; RUN:     %s -o - 2>&1 | FileCheck %s --dump-input=always
+
+; Tests that constant pool hotness is aggregated across the module. The
+; static-data-splitter processes data from cold_func first, unprofiled_func
+; secondly, and then hot_func. Specifically, tests that
+; - If a constant is accessed by hot functions, all constant pools for this
+;   constant (e.g., from an unprofiled function, or cold function) should have
+;   `.hot` suffix.
+; - Similarly if a constant is accessed by both cold function and un-profiled
+;   function, constant pools for this constant should not have `.unlikely` suffix.
+
+; CHECK:     .section	.rodata.cst8.hot,"aM", at progbits,8
+; CHECK: .LCPI0_0:
----------------
mingmingl-llvm wrote:

Yes. Constant pools for the same function are emitted back to back and labels are named like `_LCPI<FunctionIndex>_<PoolIndex>`. Grouped them by functions and use `CHECK-NEXT` in each group to make the test tighter.

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


More information about the llvm-branch-commits mailing list