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

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 09:38:49 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);
----------------
snehasish wrote:

Can this be written as `emitJumpTableImpl(*MJTI, llvm::seq(0, JT.size()), JTInDiffSection);`?

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


More information about the llvm-commits mailing list