[llvm] [AsmPrinter][ELF] Support profile-guided section prefix for jump tables' (read-only) data sections (PR #122215)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 13:04:00 PST 2025


================
@@ -2869,11 +2868,28 @@ void AsmPrinter::emitJumpTableInfo() {
           MJTI->getEntryKind() == MachineJumpTableInfo::EK_LabelDifference64,
       F);
 
-  SmallVector<unsigned> JumpTableIndices;
+  if (!TM.Options.EnableStaticDataPartitioning) {
+    SmallVector<unsigned> JumpTableIndices;
+    for (unsigned JTI = 0, JTSize = JT.size(); JTI < JTSize; ++JTI)
+      JumpTableIndices.push_back(JTI);
+    emitJumpTableImpl(*MJTI, JumpTableIndices, JTInDiffSection);
----------------
mingmingl-llvm wrote:

Thanks for the suggestion! TIL about `llvm::seq`. `llvm::to_vector(llvm::seq(<range>))` works.

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


More information about the llvm-commits mailing list