[llvm] [NFC][AsmPrinter] Refactor AsmPrinter and AArch64AsmPrinter to prepare for jump table partitions on aarch64 (PR #125993)
Mingming Liu via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 14 09:51:17 PDT 2025
================
@@ -2891,33 +2881,40 @@ void AsmPrinter::emitJumpTableInfo() {
}
}
- emitJumpTableImpl(*MJTI, HotJumpTableIndices, JTInDiffSection);
- emitJumpTableImpl(*MJTI, ColdJumpTableIndices, JTInDiffSection);
+ emitJumpTableImpl(*MJTI, HotJumpTableIndices);
+ emitJumpTableImpl(*MJTI, ColdJumpTableIndices);
}
void AsmPrinter::emitJumpTableImpl(const MachineJumpTableInfo &MJTI,
- ArrayRef<unsigned> JumpTableIndices,
- bool JTInDiffSection) {
- if (JumpTableIndices.empty())
+ ArrayRef<unsigned> JumpTableIndices) {
+ if (MJTI.getEntryKind() == MachineJumpTableInfo::EK_Inline ||
+ JumpTableIndices.empty())
return;
const TargetLoweringObjectFile &TLOF = getObjFileLowering();
const Function &F = MF->getFunction();
const std::vector<MachineJumpTableEntry> &JT = MJTI.getJumpTables();
MCSection *JumpTableSection = nullptr;
- if (TM.Options.EnableStaticDataPartitioning) {
- JumpTableSection =
- TLOF.getSectionForJumpTable(F, TM, &JT[JumpTableIndices.front()]);
- } else {
- JumpTableSection = TLOF.getSectionForJumpTable(F, TM);
- }
- const DataLayout &DL = MF->getDataLayout();
+ const bool UseLabelDifference =
+ (MJTI.getEntryKind() == MachineJumpTableInfo::EK_LabelDifference32 ||
----------------
mingmingl-llvm wrote:
done.
https://github.com/llvm/llvm-project/pull/125993
More information about the llvm-commits
mailing list