[llvm] [TableGen][InstrInfo] Cull mapping that have not been enabled/not needed (PR #126137)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 6 18:37:41 PST 2025


================
@@ -376,73 +387,66 @@ void InstrInfoEmitter::emitOperandTypeMappings(
     return NumberedInstructions[I]->TheDef->getName();
   };
   // TODO: Factor out duplicate operand lists to compress the tables.
-  if (!NumberedInstructions.empty()) {
-    std::vector<int> OperandOffsets;
-    std::vector<const Record *> OperandRecords;
-    int CurrentOffset = 0;
-    for (const CodeGenInstruction *Inst : NumberedInstructions) {
-      OperandOffsets.push_back(CurrentOffset);
-      for (const auto &Op : Inst->Operands) {
-        const DagInit *MIOI = Op.MIOperandInfo;
-        if (!ExpandMIOperandInfo || !MIOI || MIOI->getNumArgs() == 0) {
-          // Single, anonymous, operand.
-          OperandRecords.push_back(Op.Rec);
+  std::vector<size_t> OperandOffsets;
----------------
jurahul wrote:

This changed to size_t so I can use it comparison with index I get from enumerate(), which is size_t

https://github.com/llvm/llvm-project/pull/126137


More information about the llvm-commits mailing list