[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
Fri Jan 24 10:24:55 PST 2025


================
@@ -2876,42 +2875,111 @@ void AsmPrinter::emitJumpTableInfo() {
       MJTI->getEntryKind() == MachineJumpTableInfo::EK_LabelDifference32 ||
           MJTI->getEntryKind() == MachineJumpTableInfo::EK_LabelDifference64,
       F);
+
+  std::vector<unsigned> JumpTableIndices;
----------------
snehasish wrote:

I think the attempt to reuse this vector for both cases - with and without partitioning makes the code more complex than it needs to be. Consider the following refactoring:
* Sink the vector into the if condition below.
* Use separate vectors for hot and cold when partitioning is enabled.
* Use an arrayref as param for emitJumpTableImpl instead of iterator range.


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


More information about the llvm-commits mailing list