Skip to content

Commit c63687c

Browse files
authored
[MC][TableGen] Expand ImplicitOffset field of MCInstrDesc (#138127)
Increase width of ImplicitOffset to `int` from `short` to allow more table capacity. Reorder the elements to maintain natural alignment.
1 parent d11df05 commit c63687c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

llvm/include/llvm/MC/MCInstrDesc.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ class MCInstrDesc {
209209
unsigned short SchedClass; // enum identifying instr sched class
210210
unsigned char NumImplicitUses; // Num of regs implicitly used
211211
unsigned char NumImplicitDefs; // Num of regs implicitly defined
212-
unsigned short ImplicitOffset; // Offset to start of implicit op list
213212
unsigned short OpInfoOffset; // Offset to info about operands
213+
unsigned int ImplicitOffset; // Offset to start of implicit op list
214214
uint64_t Flags; // Flags identifying machine instr class
215215
uint64_t TSFlags; // Target Specific Flag values
216216

llvm/utils/TableGen/InstrInfoEmitter.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -1106,12 +1106,14 @@ void InstrInfoEmitter::emitRecord(
11061106
OS << Inst.ImplicitUses.size() << ",\t" << Inst.ImplicitDefs.size() << ",\t";
11071107
std::vector<const Record *> ImplicitOps = Inst.ImplicitUses;
11081108
llvm::append_range(ImplicitOps, Inst.ImplicitDefs);
1109-
OS << Target.getName() << "ImpOpBase + " << EmittedLists[ImplicitOps]
1110-
<< ",\t";
11111109

11121110
// Emit the operand info offset.
11131111
OperandInfoTy OperandInfo = GetOperandInfo(Inst);
1114-
OS << OperandInfoMap.find(OperandInfo)->second << ",\t0";
1112+
OS << OperandInfoMap.find(OperandInfo)->second << ",\t";
1113+
1114+
// Emit implicit operand base.
1115+
OS << Target.getName() << "ImpOpBase + " << EmittedLists[ImplicitOps]
1116+
<< ",\t0";
11151117

11161118
// Emit all of the target independent flags...
11171119
if (Inst.isPreISelOpcode)

0 commit comments

Comments
 (0)