[PATCH] D63374: [TableGen] Add "MCInstValidatorEmitter" TableGen backend

Nicolas Guillemot via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 10:15:30 PDT 2019


nlguillemot added inline comments.


================
Comment at: utils/TableGen/MCInstValidatorEmitter.cpp:61
+      unsigned MCOperandPredicateID = (unsigned)MCOperandPredicates.size();
+      MCOperandPredicates.insert(CachedHashString(SI->getValue()));
+      OperandToMCOperandPredicateID.emplace(Op, MCOperandPredicateID);
----------------
bug: If the value is already present in the `SetVector`, the `MCOperandPredicateID` should be set to its existing ID. As-is, it creates a new ID even when the value should be reused. Should be able to reproduce the bug by updating the unit test to have two instructions that share the same `MCOperandPredicate`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63374/new/

https://reviews.llvm.org/D63374





More information about the llvm-commits mailing list