[llvm] 146abed - [AArch64][NFC] Avoid relocations in LdStNInstrDesc (#202025)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 9 10:46:25 PDT 2026
Author: Alexis Engelke
Date: 2026-06-09T19:46:21+02:00
New Revision: 146abed5cd072a27c4240c7cf53b764571e62462
URL: https://github.com/llvm/llvm-project/commit/146abed5cd072a27c4240c7cf53b764571e62462
DIFF: https://github.com/llvm/llvm-project/commit/146abed5cd072a27c4240c7cf53b764571e62462.diff
LOG: [AArch64][NFC] Avoid relocations in LdStNInstrDesc (#202025)
These are small strings, so instead of an 8 byte string pointer that
needs a relocation store the strings directly inline. This avoids 320
relocations in libLLVM.so.
Added:
Modified:
llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
index 2df769539960d..9134203a2da2a 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
@@ -421,11 +421,11 @@ static bool isTblTbxInstruction(unsigned Opcode, StringRef &Layout,
struct LdStNInstrDesc {
unsigned Opcode;
- const char *Mnemonic;
- const char *Layout;
- int ListOperand;
- bool HasLane;
- int NaturalOffset;
+ char Mnemonic[5];
+ char Layout[5];
+ uint8_t ListOperand : 2;
+ uint8_t HasLane : 1;
+ uint8_t NaturalOffset;
};
static const LdStNInstrDesc LdStNInstInfo[] = {
@@ -827,7 +827,7 @@ void AArch64AppleInstPrinter::printInst(const MCInst *MI, uint64_t Address,
} else {
assert(LdStDesc->NaturalOffset && "no offset on post-inc instruction?");
O << ", ";
- markup(O, Markup::Immediate) << "#" << LdStDesc->NaturalOffset;
+ markup(O, Markup::Immediate) << "#" << int(LdStDesc->NaturalOffset);
}
}
More information about the llvm-commits
mailing list