[llvm] 91e77d8 - [TableGen] Restore OpName::OPERAND_LAST emission in InstrInfoEmitter (#125265)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 31 13:19:15 PST 2025
Author: Rahul Joshi
Date: 2025-01-31T13:19:11-08:00
New Revision: 91e77d88a40f91d4da79c478dbb7d447bb59ed14
URL: https://github.com/llvm/llvm-project/commit/91e77d88a40f91d4da79c478dbb7d447bb59ed14
DIFF: https://github.com/llvm/llvm-project/commit/91e77d88a40f91d4da79c478dbb7d447bb59ed14.diff
LOG: [TableGen] Restore OpName::OPERAND_LAST emission in InstrInfoEmitter (#125265)
- Looks like this sentinel value is used in some downstream backends, so
restore emitting it.
- It now also has the correct value (earlier code may have emitted an
incorrect value for OPERAND_LAST and hence it was removed in
https://github.com/llvm/llvm-project/pull/124960)
Added:
Modified:
llvm/utils/TableGen/InstrInfoEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp
index 55e9d576b9b068..97c00ad4924197 100644
--- a/llvm/utils/TableGen/InstrInfoEmitter.cpp
+++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp
@@ -286,6 +286,7 @@ void InstrInfoEmitter::emitOperandNameMappings(
OS << "enum {\n";
for (const auto &[I, Op] : enumerate(OperandNameToID))
OS << " " << Op.first << " = " << I << ",\n";
+ OS << " OPERAND_LAST = " << NumOperandNames << ",\n";
OS << "};\n";
OS << "} // end namespace llvm::" << Namespace << "::OpName\n";
OS << "#endif //GET_INSTRINFO_OPERAND_ENUM\n\n";
More information about the llvm-commits
mailing list