-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[MC][TableGen] Expand ImplicitOffset field of MCInstrDesc #138127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Increase width of ImplicitOffset to int from short to allow more table capacity. Reorder the elements to maintain natural alignment.
@llvm/pr-subscribers-tablegen Author: Carl Ritson (perlfu) ChangesIncrease width of ImplicitOffset to Full diff: https://github.com/llvm/llvm-project/pull/138127.diff 2 Files Affected:
diff --git a/llvm/include/llvm/MC/MCInstrDesc.h b/llvm/include/llvm/MC/MCInstrDesc.h
index ef0b3c0a73992..5bb7f18bf2587 100644
--- a/llvm/include/llvm/MC/MCInstrDesc.h
+++ b/llvm/include/llvm/MC/MCInstrDesc.h
@@ -209,8 +209,8 @@ class MCInstrDesc {
unsigned short SchedClass; // enum identifying instr sched class
unsigned char NumImplicitUses; // Num of regs implicitly used
unsigned char NumImplicitDefs; // Num of regs implicitly defined
- unsigned short ImplicitOffset; // Offset to start of implicit op list
unsigned short OpInfoOffset; // Offset to info about operands
+ unsigned int ImplicitOffset; // Offset to start of implicit op list
uint64_t Flags; // Flags identifying machine instr class
uint64_t TSFlags; // Target Specific Flag values
diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp
index 377bfb593be5f..f240cab040caa 100644
--- a/llvm/utils/TableGen/InstrInfoEmitter.cpp
+++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp
@@ -1106,12 +1106,14 @@ void InstrInfoEmitter::emitRecord(
OS << Inst.ImplicitUses.size() << ",\t" << Inst.ImplicitDefs.size() << ",\t";
std::vector<const Record *> ImplicitOps = Inst.ImplicitUses;
llvm::append_range(ImplicitOps, Inst.ImplicitDefs);
- OS << Target.getName() << "ImpOpBase + " << EmittedLists[ImplicitOps]
- << ",\t";
// Emit the operand info offset.
OperandInfoTy OperandInfo = GetOperandInfo(Inst);
- OS << OperandInfoMap.find(OperandInfo)->second << ",\t0";
+ OS << OperandInfoMap.find(OperandInfo)->second << ",\t";
+
+ // Emit implicit operand base.
+ OS << Target.getName() << "ImpOpBase + " << EmittedLists[ImplicitOps]
+ << ",\t0";
// Emit all of the target independent flags...
if (Inst.isPreISelOpcode)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This does not change the size of MCInstrDesc
, right?
Unless the architecture is packing the structure (unlikely) then it should maintain the |
Increase width of ImplicitOffset to `int` from `short` to allow more table capacity. Reorder the elements to maintain natural alignment.
Increase width of ImplicitOffset to `int` from `short` to allow more table capacity. Reorder the elements to maintain natural alignment.
Increase width of ImplicitOffset to `int` from `short` to allow more table capacity. Reorder the elements to maintain natural alignment.
Increase width of ImplicitOffset to `int` from `short` to allow more table capacity. Reorder the elements to maintain natural alignment.
Increase width of ImplicitOffset to
int
fromshort
to allow more table capacity.Reorder the elements to maintain natural alignment.